-
Notifications
You must be signed in to change notification settings - Fork 277
71 lines (60 loc) · 1.94 KB
/
fortigate-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: fortigate-test
"on":
workflow_call:
inputs:
py_ver:
required: true
type: string
jobs:
fortigate-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
runtime:
- "docker"
test-suite:
- "01*.robot"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: containerlab
- name: Move containerlab to usr/bin
run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.py_ver }}
cache: pip
cache-dependency-path: "tests/requirements.txt"
- name: Install robotframework
run: |
pip install -r tests/requirements.txt
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Sanitize test-suite name
run: echo "TEST_SUITE=$(echo ${{ matrix.test-suite }} | tr -d '*')" >> $GITHUB_ENV
- name: Run tests
run: |
bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/09-fortigate/${{ matrix.test-suite }}
# upload test reports as a zip file
- uses: actions/upload-artifact@v4
if: always()
with:
name: 09-fortigate-log-${{ env.TEST_SUITE }}-${{ matrix.runtime }}
path: ./tests/out/*.html
# upload coverage report from unit tests, as they are then
# merged with e2e tests coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-fortigate-tests-${{ env.TEST_SUITE }}-${{ matrix.runtime }}
path: /tmp/clab-tests/coverage/*
retention-days: 7