-
Notifications
You must be signed in to change notification settings - Fork 148
60 lines (58 loc) · 2.03 KB
/
build_and_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
name: Build and Test
on: [ push, pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-22.04
container:
image: concordbft/concord-bft:latest
options: --cap-add=NET_ADMIN
strategy:
fail-fast: false
matrix:
compiler: [g++]
ci_build_type: [Debug, Release]
comm_type:
- "-DBUILD_COMM_UDP=ON -DBUILD_COMM_TCP_TLS=OFF -DBUILD_COMM_TCP_PLAIN=OFF"
- "-DBUILD_COMM_UDP=OFF -DBUILD_COMM_TCP_TLS=ON -DBUILD_COMM_TCP_PLAIN=OFF"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
mkdir build
cd build
echo $(date +%y-%m-%d_%H-%M-%S) > timestamp
cmake \
${{ matrix.comm_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.ci_build_type }} \
-DBUILD_TESTING=ON \
..
make -j$(nproc)
- name: Test
run: |
cd build
# many tests require administrative priviliges for running iptables or nc
sudo ctest --output-on-failure
- name: Print failed cases
if: ${{ failure() }}
run: |
FAILED_CASES_FILE=${PWD}/build/apollogs/latest/failed_cases.txt
test -f ${FAILED_CASES_FILE} && echo Failed apollo cases: && cat -n ${FAILED_CASES_FILE}
- name: Prepare artifacts
if: ${{ failure() }}
run: |
mkdir -p artifact
sudo chown -R ${USER}:${GROUP} ${PWD}/build
tar -czvf artifact/logs.tar.gz ./build/tests/apollo/logs
- name: Upload artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: artifacts-${{ matrix.ci_build_type }}-${{ matrix.comm_type }}-${{ github.sha }}
path: artifact/
retention-days: 7