4 group: test-${{ github.head_ref }}
5 cancel-in-progress: true
27 image: debian:bullseye
32 uses: actions/checkout@v1
35 run: HOST=${{ matrix.arch }} sh .ci/deps.sh
37 - name: Prepare the system
38 run: HOST=${{ matrix.arch }} sh .ci/test/prepare.sh
40 - name: Run tests with default settings
41 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh default
43 - name: Run tests without legacy protocol
44 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh nolegacy
47 - name: Run tests with libgcrypt
48 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh gcrypt
51 - name: Upload test results
52 uses: actions/upload-artifact@v2
54 name: tests_cross_${{ matrix.arch }}
55 path: /tmp/logs/tests.*.tar.gz
62 image: debian:bullseye-slim
68 uses: actions/checkout@v1
70 - name: Install dependencies
71 run: SKIP_OPENSSL3=1 SKIP_MESON=1 .ci/deps.sh libpkgconf-dev
73 - name: Compatibility with muon
74 run: ./.ci/muon/run.sh
81 uses: actions/checkout@v3
85 - name: Install dependencies
86 run: sudo SKIP_OPENSSL3=1 .ci/deps.sh autoconf automake iperf3
88 - name: Compatibility with older versions of tinc
89 run: sudo ./.ci/compat/run.sh
94 sudo apt-get install -y astyle clang-tidy-$CLANG
95 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
96 sudo update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-$CLANG 100
97 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
98 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
99 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
100 chmod 755 ~/shfmt ~/shellcheck
101 python3 -m venv /tmp/venv
102 . /tmp/venv/bin/activate
103 pip3 install black pylint mypy
110 - name: Lint/typecheck/check formatting on C/shell/Python code
112 . /tmp/venv/bin/activate
113 PATH=$PATH:$HOME ./lint.py
116 - name: Check warnings (clang)
117 run: bash .ci/warn/run.sh
122 - name: Check warnings (gcc)
123 run: bash .ci/warn/run.sh
128 - name: Archive test results
129 run: sudo tar -caf tests.tar.gz /usr/local/etc
130 continue-on-error: true
133 - name: Upload test results
134 uses: actions/upload-artifact@v2
141 runs-on: ubuntu-22.04
151 SANITIZER: "${{ matrix.sanitizer }}"
154 - name: Checkout code
155 uses: actions/checkout@v1
160 sudo pip3 install --upgrade cryptography
162 - name: Run tests with OpenSSL 3
163 run: bash .ci/sanitizers/run.sh openssl3
166 - name: Sanitize tests with default settings
167 run: bash .ci/sanitizers/run.sh default
170 - name: Sanitize tests without legacy protocol
171 run: bash .ci/sanitizers/run.sh nolegacy
174 - name: Run tests with libgcrypt
175 run: bash .ci/sanitizers/run.sh gcrypt
178 - name: Upload test results
179 uses: actions/upload-artifact@v2
181 name: tests_sanitizer_${{ matrix.sanitizer }}
182 path: /tmp/logs/tests.*.tar.gz
186 runs-on: ubuntu-22.04
194 - centos:7 # aka RHEL 7
195 - almalinux:8 # aka RHEL 8
196 - almalinux:9 # aka RHEL 9
201 - ubuntu # current LTS
202 - ubuntu:rolling # latest
204 image: ${{ matrix.os }}
205 options: --privileged
209 - name: Checkout code
210 uses: actions/checkout@v1
215 - name: Assign name for test results artifact
216 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
218 - name: Create a non-privileged user
219 run: sh .ci/test/prepare.sh
221 - name: Run tests with OpenSSL 3
222 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
224 - name: Run tests with default settings
225 run: sudo -u build CI=1 sh .ci/test/run.sh default
228 - name: Run tests without legacy protocol
229 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
232 - name: Run tests with libgcrypt
233 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
236 - name: Upload test results
237 uses: actions/upload-artifact@v2
239 name: tests_${{ env.ARTIFACT }}
240 path: /tmp/logs/tests.*.tar.gz
243 - name: Build package
244 run: sh .ci/package/build.sh
245 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
246 continue-on-error: true
248 - name: Upload package
249 uses: actions/upload-artifact@v2
251 name: pkg-${{ env.ARTIFACT }}
254 ~/rpmbuild/RPMS/*/*.rpm
255 continue-on-error: true
258 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
259 runs-on: ubuntu-22.04
260 continue-on-error: true
266 - name: Create artifact directory
267 run: mkdir -p /tmp/artifacts
269 - name: Download packages
270 uses: actions/download-artifact@v2
274 - name: Publish packages (dev)
275 uses: marvinpinto/action-automatic-releases@latest
277 repo_token: ${{ secrets.GITHUB_TOKEN }}
278 automatic_release_tag: latest
279 title: Development release
281 files: /tmp/artifacts/**/*.(deb|rpm|exe)
282 if: startsWith(github.ref, 'refs/heads/')
284 - name: Publish packages (release)
285 uses: softprops/action-gh-release@v1
288 /tmp/artifacts/**/*.deb
289 /tmp/artifacts/**/*.rpm
290 /tmp/artifacts/**/*.exe
291 if: startsWith(github.ref, 'refs/tags/')
298 - name: Checkout code
299 uses: actions/checkout@v1
301 - name: Install build deps
304 - name: Run tests with default settings
305 run: sh .ci/test/run.sh default
307 - name: Run tests without legacy protocol
308 run: sh .ci/test/run.sh nolegacy
311 - name: Run tests with libgcrypt
312 run: sh .ci/test/run.sh gcrypt
315 - name: Upload test results
316 uses: actions/upload-artifact@v2
319 path: /tmp/logs/tests.*.tar.gz
323 runs-on: windows-latest
327 - name: Install msys2
328 uses: msys2/setup-msys2@v2
331 # https://packages.msys2.org/package/
334 mingw-w64-x86_64-meson
335 mingw-w64-x86_64-pkgconf
337 mingw-w64-x86_64-openssl
338 mingw-w64-x86_64-libgcrypt
339 mingw-w64-x86_64-zlib
340 mingw-w64-x86_64-lzo2
342 mingw-w64-x86_64-ncurses
343 mingw-w64-x86_64-miniupnpc
344 mingw-w64-x86_64-nsis
349 - name: Checkout code
350 uses: actions/checkout@v1
352 - name: Run tests with default settings
354 run: sh .ci/test/run.sh default
356 - name: Create installer
358 run: sh .ci/package/build.sh
359 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
360 continue-on-error: true
362 - name: Upload package
363 uses: actions/upload-artifact@v2
366 path: .ci/package/win/tinc-*.exe
367 continue-on-error: true
369 - name: Run tests without legacy protocol
371 run: sh .ci/test/run.sh nolegacy
374 - name: Run tests with libgcrypt
376 run: sh .ci/test/run.sh gcrypt
379 - name: Upload test results
380 uses: actions/upload-artifact@v2
383 path: /tmp/logs/tests.*.tar.gz
387 runs-on: windows-latest
394 - { build: amd64, host: amd64, test: test }
395 - { build: amd64, host: x86, test: test }
396 - { build: amd64, host: arm64, test: notest }
399 HOST_ARCH: ${{ matrix.target.host }}
400 BUILD_ARCH: ${{ matrix.target.build }}
403 - name: Install meson
404 run: pip3 install meson
406 - name: Checkout code
407 uses: actions/checkout@v1
409 - name: Activate dev environment
410 uses: ilammy/msvc-dev-cmd@v1
412 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
414 - name: Build (nolegacy)
415 run: .ci\windows\build.cmd nolegacy
417 - name: Test (nolegacy)
418 run: .ci\windows\test.cmd nolegacy
419 if: always() && matrix.target.test == 'test'
421 - name: Build (OpenSSL)
422 run: .ci\windows\build.cmd openssl
425 - name: Test (OpenSSL)
426 run: .ci\windows\test.cmd openssl
427 if: always() && matrix.target.test == 'test'