-
Notifications
You must be signed in to change notification settings - Fork 4
132 lines (118 loc) · 3.39 KB
/
main.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
sonarcloud:
strategy:
fail-fast: false
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: sonarcloud
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1
- name: Autoreconf
run: autoreconf -i
- name: Configure
run: ./configure
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define project.settings=.github/sonar-project.properties --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
codecov:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: |
sudo apt update && sudo apt install -y libgtest-dev
pip3 install gcovr
- name: Autoreconf
run: autoreconf -i
- name: Configure
run: ./configure --enable-gcovr
- name: Make
run: make
- name: Run tests
run: make check -C test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test/coverage/codecov.xml
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
brew install automake argp-standalone googletest
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update && sudo apt install -y libgtest-dev
fi
- name: Autoreconf
run: autoreconf -i
- name: Configure
run: ./configure
- name: Make
run: make
- name: Run tests
run: make check -C test
- name: Upload test log
if: always()
uses: actions/upload-artifact@v3
with:
name: test_log_${{ github.job }}_${{ matrix.os }}
path: |
test/*.log
config.log
benchmark:
needs: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
brew install automake argp-standalone google-benchmark
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update && sudo apt install -y libbenchmark-dev
fi
- name: Autoreconf
run: autoreconf -i
- name: Configure
run: ./configure
- name: Make
run: make
- name: Run benchmark tests
run: make check -C benchmark
- name: Upload test log
if: always()
uses: actions/upload-artifact@v3
with:
name: test_log_${{ github.job }}_${{ matrix.os }}
path: |
benchmark/*.log
config.log