-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (67 loc) · 2.19 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: install Qemu
run: |
uname -a
sudo apt-get update -y
sudo apt-get install -y cloud-utils qemu-system-x86
- name: Install munet project
run: poetry install --all-extras --no-interaction
- name: Lint the project
run: make ci-lint
- name: Verify json schema is up-to-date
run: |
make munet/munet-schema.json
bash -c '[[ -z "$(git status -s --untracked=no)" ]]'
- name: Run YANG tests
run: make test-validate
- name: Make sure podman image is present
run: sudo podman pull docker.io/labn/docker-ci-test:20.04
- name: Expose the environment
run: |
uname -a || true
cat /etc/os-release || true
cat /proc/meminfo || true
cat /proc/cpuinfo || true
- name: Run main tests
run: |
make FETCH_GH_TOKEN="${{ secrets.FETCH_GH_TOKEN }}" test
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
verbose: true
files: ./coverage.xml
# fail_ci_if_error: false
- name: Collect test logs
if: ${{ always() }}
run: |
sudo find /tmp/unet-test -type s -exec rm {} +
mkdir -p test-logs
sudo tar -C /tmp/unet-test -cf - . | tar -C test-logs -xf -
tar -cjf test-logs.tar.bz2 test-logs
- name: Archive test logs tarball
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-logs-tar-${{ matrix.python-version }}
path: test-logs.tar.bz2