-
Notifications
You must be signed in to change notification settings - Fork 279
88 lines (73 loc) · 2.42 KB
/
cisco_iol-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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: cisco_iol-tests
"on":
workflow_call:
inputs:
py_ver:
required: true
type: string
jobs:
cisco_iol-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 chown root:root /usr/bin/containerlab && sudo chmod 4755 /usr/bin/containerlab
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
# Install a specific version of uv.
version: "0.5.28"
enable-cache: true
- uses: actions/setup-python@v5
with:
# cache: pip
# cache-dependency-path: "tests/requirements.txt"
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --all-extras --dev
# - name: setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Activate virtualenv
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- 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: setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run tests
run: |
bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/10-basic-cisco_iol/${{ matrix.test-suite }}
# upload test reports as a zip file
- uses: actions/upload-artifact@v4
if: always()
with:
name: 10-cisco_iol-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-cisco_iol-tests-${{ env.TEST_SUITE }}-${{ matrix.runtime }}
path: /tmp/clab-tests/coverage/*
retention-days: 7