-
Notifications
You must be signed in to change notification settings - Fork 331
84 lines (79 loc) · 2.28 KB
/
test.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
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
check-changes:
name: Check whether tests need to be run based on diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: antrea-io/has-changes@v2
id: check_diff
with:
paths-ignore: docs/* *.md
outputs:
has_changes: ${{ steps.check_diff.outputs.has_changes }}
test:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cxx: g++
cc: gcc
- cxx: clang++-8
cc: clang-8
- cxx: clang++-10
cc: clang-10
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build test Docker image
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
docker build -t bm --build-arg IMAGE_TYPE=test --build-arg CC=$CC --build-arg CXX=$CXX --build-arg GCOV=$GCOV .
- name: Run tests
run: |
ci_env=`bash <(curl -s https://codecov.io/env)`
docker run --rm $ci_env --env GCOV -w /behavioral-model bm /bin/bash -c "make check -j$(nproc) && ./ci/codecov.sh"
- name: Check style
run: |
./tools/check_style.sh
test-no-pi:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build Dockerfile.noPI image
run: docker build -t bm-no-pi --build-arg IMAGE_TYPE=test -f Dockerfile.noPI .
- name: Run tests
run: docker run --rm -w /behavioral-model bm-no-pi /bin/bash -c "make check -j$(nproc)"
test-ubuntu22:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
run: sudo ./install_deps_ubuntu_22.04.sh
- name: Build BMv2
run: |
./autogen.sh
./configure --with-pdfixed --with-pi --with-stress-tests --enable-debugger --enable-Werror
make -j$(nproc)
- name: Run tests
run: make check -j$(nproc)