-
Notifications
You must be signed in to change notification settings - Fork 127
155 lines (130 loc) · 4.64 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
# one scheduled build on the first day of every month at 3:05
- cron: '5 3 1 * *'
jobs:
ubuntu:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
compiler: [gcc, clang]
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.compiler }}
CFLAGS: "${{ matrix.compiler == 'gcc' && '-Wall -Wextra -O2' || '-Weverything -Wno-padded' }}"
CPARAMS: "${{ matrix.compiler == 'gcc' && '--enable-werror' || ' ' }}"
steps:
- uses: actions/checkout@v3
- name: dependencies
run: sudo make -f .github/Makefile.CI dependencies_ubuntu
- name: configure
run: |
$CC --version
./configure $CPARAMS
- name: make check
run: make check || ( cat test.log test-suite.log ; exit 1 )
- name: version
run: |
./vnstat --version
./vnstatd --version
./vnstati --version
ubuntu_clang_sanitizers:
runs-on: ubuntu-22.04
env:
CC: clang
CFLAGS: '-Wall -Wextra -O1 -g -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=nullability -fsanitize=implicit-conversion -fsanitize=integer -fsanitize=float-divide-by-zero -fsanitize=local-bounds'
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
UBSAN_OPTIONS: print_stacktrace=1:print_summary=1:halt_on_error=1
steps:
- uses: actions/checkout@v3
- name: dependencies
run: sudo make -f .github/Makefile.CI dependencies_ubuntu
- name: configure
run: |
$CC --version
./configure --enable-werror
- name: make check
run: make check || ( cat test.log test-suite.log ; exit 1 )
- name: version
run: |
./vnstat --version
./vnstatd --version
./vnstati --version
- name: verify log
run: grep -iP 'sanitizer|runtime error' check_vnstat.log && exit 1 || true
ubuntu_clang_analyzer:
runs-on: ubuntu-22.04
env:
CC: clang
CFLAGS: '-Wall -Wextra'
steps:
- uses: actions/checkout@v3
- name: dependencies
run: sudo make -f .github/Makefile.CI dependencies_ubuntu_analyzer
- name: configure
run: |
$CC --version
scan-build -analyze-headers --status-bugs ./configure --enable-werror
- name: make
run: scan-build -analyze-headers --status-bugs make
macos_clang:
runs-on: macos-12
env:
CC: clang
CFLAGS: '-Weverything -Wno-padded -Wno-poison-system-directories'
steps:
- uses: actions/checkout@v3
- name: dependencies
run: make -f .github/Makefile.CI dependencies_macos
- name: configure
run: |
$CC --version
./configure
- name: make check
run: make check || ( cat test.log test-suite.log ; exit 1 )
- name: version
run: |
./vnstat --version
./vnstatd --version
./vnstati --version
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check spelling
uses: crate-ci/typos@master
with:
files: ./man ./examples ./cfg ./CHANGES ./INSTALL* ./README* ./U*
isolated: true
- name: Run Perl::Critic
uses: natanlao/[email protected]
dev_docker_trigger:
needs: [lint, ubuntu, ubuntu_clang_sanitizers, ubuntu_clang_analyzer]
runs-on: ubuntu-latest
steps:
- name: trigger dev container build
if: ${{ github.ref == 'refs/heads/master' && contains('push workflow_dispatch schedule', github.event_name) && success() }}
run: |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.ACTION_TRIGGER }}" \
-d '{"ref":"refs/heads/master"}' \
$GITHUB_API_URL/repos/vergoh/vnstat-docker/actions/workflows/dev.yml/dispatches
edge_snap_trigger:
needs: [lint, ubuntu, ubuntu_clang_sanitizers, ubuntu_clang_analyzer]
runs-on: ubuntu-latest
steps:
- name: trigger edge snap build trigger
if: ${{ github.ref == 'refs/heads/master' && contains('push workflow_dispatch schedule', github.event_name) && success() }}
run: |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.ACTION_TRIGGER }}" \
-d '{"ref":"refs/heads/master"}' \
$GITHUB_API_URL/repos/vergoh/vnstat-snap/actions/workflows/edge.yml/dispatches