12 runs-on: ubuntu-latest
23 image: debian:bullseye
28 uses: actions/checkout@v1
31 run: HOST=${{ matrix.arch }} sh .ci/deps.sh
33 - name: Prepare the system
34 run: HOST=${{ matrix.arch }} sh .ci/test/prepare.sh
36 - name: Run tests with default settings
37 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh default
39 - name: Run tests without legacy protocol
40 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh nolegacy
43 - name: Run tests with libgcrypt
44 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh gcrypt
46 - name: Upload test results
47 uses: actions/upload-artifact@v2
49 name: tests_cross_${{ matrix.arch }}
50 path: /tmp/logs/tests.*.tar.gz
54 runs-on: ubuntu-latest
58 uses: actions/checkout@v1
62 sudo apt-get install -y astyle clang-tidy-$CLANG
63 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
64 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
65 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
66 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
67 chmod 755 ~/shfmt ~/shellcheck
68 pip3 install --user compiledb
75 run: sudo sh .ci/deps.sh
77 - name: Run clang-tidy
78 run: sh .ci/tidy/run.sh
81 - name: Check code formatting
82 run: "! astyle --exclude=build -r --options=.astylerc --dry-run --formatted '*.c' '*.h' | grep '^Formatted'"
85 - name: Check scripts formatting
86 run: find -type f -regextype egrep -regex '.+\.(sh|sh\.in|test)$' -exec ~/shfmt -d -i 2 -s '{}' +
89 - name: Run static analysis on scripts
90 run: find -type f -regextype egrep -regex '.+\.sh(\.in)?$' -exec shellcheck -x '{}' +
93 - name: Run static analysis on tests
94 run: find -type f -name '*.test' -execdir shellcheck -x '{}' +
97 - name: Check warnings (gcc)
98 run: bash .ci/warn/run.sh
103 - name: Check warnings (clang)
104 run: bash .ci/warn/run.sh
110 runs-on: ubuntu-latest
120 SANITIZER: "${{ matrix.sanitizer }}"
123 - name: Checkout code
124 uses: actions/checkout@v1
127 run: sudo sh .ci/deps.sh
129 - name: Run tests with OpenSSL 3
130 run: bash .ci/sanitizers/run.sh openssl3
132 - name: Sanitize tests with default settings
133 run: bash .ci/sanitizers/run.sh default
135 - name: Sanitize tests without legacy protocol
136 run: bash .ci/sanitizers/run.sh nolegacy
139 - name: Upload test results
140 uses: actions/upload-artifact@v2
142 name: tests_sanitizer_${{ matrix.sanitizer }}
143 path: /tmp/logs/tests.*.tar.gz
147 runs-on: ubuntu-latest
154 - centos:7 # aka RHEL 7
155 - almalinux:8 # aka RHEL 8
160 - ubuntu # current LTS
161 - ubuntu:rolling # latest
163 image: ${{ matrix.os }}
164 options: --privileged
168 - name: Checkout code
169 uses: actions/checkout@v1
174 - name: Assign name for test results artifact
175 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
177 - name: Create a non-privileged user
178 run: sh .ci/test/prepare.sh
180 - name: Run tests with OpenSSL 3
181 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
183 - name: Run tests with default settings
184 run: sudo -u build CI=1 sh .ci/test/run.sh default
186 - name: Run tests without legacy protocol
187 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
190 - name: Run tests with libgcrypt
191 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
193 - name: Upload test results
194 uses: actions/upload-artifact@v2
196 name: tests_${{ env.ARTIFACT }}
197 path: /tmp/logs/tests.*.tar.gz
200 - name: Build package
201 run: sh .ci/package/build.sh
202 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
204 - name: Upload package
205 uses: actions/upload-artifact@v2
207 name: pkg-${{ env.ARTIFACT }}
210 ~/rpmbuild/RPMS/*/*.rpm
213 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
214 runs-on: ubuntu-latest
220 - name: Create artifact directory
221 run: mkdir -p /tmp/artifacts
223 - name: Download packages
224 uses: actions/download-artifact@v2
228 - name: Publish packages (dev)
229 uses: marvinpinto/action-automatic-releases@latest
231 repo_token: ${{ secrets.GITHUB_TOKEN }}
232 automatic_release_tag: latest
233 title: Development release
235 files: /tmp/artifacts/**/*.(deb|rpm|exe)
236 if: startsWith(github.ref, 'refs/heads/')
238 - name: Publish packages (release)
239 uses: softprops/action-gh-release@v1
242 /tmp/artifacts/**/*.deb
243 /tmp/artifacts/**/*.rpm
244 /tmp/artifacts/**/*.exe
245 if: startsWith(github.ref, 'refs/tags/')
248 runs-on: macos-latest
252 - name: Checkout code
253 uses: actions/checkout@v1
255 - name: Install build deps
258 - name: Run tests with default settings
259 run: sh .ci/test/run.sh default
261 - name: Run tests without legacy protocol
262 run: sh .ci/test/run.sh nolegacy
265 - name: Run tests with libgcrypt
266 run: sh .ci/test/run.sh gcrypt
268 - name: Upload test results
269 uses: actions/upload-artifact@v2
272 path: /tmp/logs/tests.*.tar.gz
276 runs-on: windows-latest
280 - name: Install msys2
281 uses: msys2/setup-msys2@v2
284 # https://packages.msys2.org/package/
287 mingw-w64-x86_64-meson
288 mingw-w64-x86_64-pkgconf
290 mingw-w64-x86_64-openssl
291 mingw-w64-x86_64-libgcrypt
292 mingw-w64-x86_64-zlib
293 mingw-w64-x86_64-lzo2
295 mingw-w64-x86_64-ncurses
296 mingw-w64-x86_64-miniupnpc
297 mingw-w64-x86_64-nsis
302 - name: Checkout code
303 uses: actions/checkout@v1
305 - name: Run tests with default settings
307 run: sh .ci/test/run.sh default
309 - name: Create installer
311 run: sh .ci/package/build.sh
312 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
314 - name: Upload package
315 uses: actions/upload-artifact@v2
318 path: .ci/package/win/tinc-*.exe
320 - name: Run tests without legacy protocol
322 run: sh .ci/test/run.sh nolegacy
325 - name: Run tests with libgcrypt
327 run: sh .ci/test/run.sh gcrypt
329 - name: Upload test results
330 uses: actions/upload-artifact@v2
333 path: /tmp/logs/tests.*.tar.gz
337 runs-on: windows-latest
348 - name: Install meson
349 run: pip3 install meson
351 - name: Checkout code
352 uses: actions/checkout@v1
354 - name: Activate dev environment
355 uses: ilammy/msvc-dev-cmd@v1
357 arch: ${{ matrix.arch }}
359 - name: Build (nolegacy)
360 run: .ci\windows\build.cmd nolegacy
362 - name: Test (nolegacy)
363 run: .ci\windows\test.cmd nolegacy
366 - name: Build (OpenSSL)
367 run: .ci\windows\build.cmd openssl
370 - name: Test (OpenSSL)
371 run: .ci\windows\test.cmd openssl