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 markflow
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: Check that very long paths work
131 meson test -C "$WD" --verbose
133 WD: /tmp/tinc_testing_directory_with_a_very_long_path_which_goes_over_the_108_char_limit_on_unix_socket_file_paths
136 - name: Archive test results
137 run: sudo tar -caf tests.tar.gz /usr/local/etc
138 continue-on-error: true
141 - name: Upload test results
142 uses: actions/upload-artifact@v2
149 runs-on: ubuntu-22.04
159 SANITIZER: "${{ matrix.sanitizer }}"
162 - name: Checkout code
163 uses: actions/checkout@v1
168 sudo pip3 install --upgrade cryptography
170 - name: Run tests with OpenSSL 3
171 run: bash .ci/sanitizers/run.sh openssl3
174 - name: Sanitize tests with default settings
175 run: bash .ci/sanitizers/run.sh default
178 - name: Sanitize tests without legacy protocol
179 run: bash .ci/sanitizers/run.sh nolegacy
182 - name: Run tests with libgcrypt
183 run: bash .ci/sanitizers/run.sh gcrypt
186 - name: Upload test results
187 uses: actions/upload-artifact@v2
189 name: tests_sanitizer_${{ matrix.sanitizer }}
190 path: /tmp/logs/tests.*.tar.gz
194 runs-on: ubuntu-22.04
202 - centos:7 # aka RHEL 7
203 - almalinux:8 # aka RHEL 8
204 - almalinux:9 # aka RHEL 9
209 - ubuntu # current LTS
210 - ubuntu:rolling # latest
212 image: ${{ matrix.os }}
213 options: --privileged
217 - name: Checkout code
218 uses: actions/checkout@v1
223 - name: Assign name for test results artifact
224 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
226 - name: Create a non-privileged user
227 run: sh .ci/test/prepare.sh
229 - name: Run tests with OpenSSL 3
230 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
232 - name: Run tests with default settings
233 run: sudo -u build CI=1 sh .ci/test/run.sh default
236 - name: Run tests without legacy protocol
237 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
240 - name: Run tests with libgcrypt
241 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
244 - name: Upload test results
245 uses: actions/upload-artifact@v2
247 name: tests_${{ env.ARTIFACT }}
248 path: /tmp/logs/tests.*.tar.gz
251 - name: Build package
252 run: sh .ci/package/build.sh
253 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
254 continue-on-error: true
256 - name: Upload package
257 uses: actions/upload-artifact@v2
259 name: pkg-${{ env.ARTIFACT }}
262 ~/rpmbuild/RPMS/*/*.rpm
263 continue-on-error: true
266 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
267 runs-on: ubuntu-22.04
268 continue-on-error: true
274 - name: Create artifact directory
275 run: mkdir -p /tmp/artifacts
277 - name: Download packages
278 uses: actions/download-artifact@v2
282 - name: Publish packages (dev)
283 uses: marvinpinto/action-automatic-releases@latest
285 repo_token: ${{ secrets.GITHUB_TOKEN }}
286 automatic_release_tag: latest
287 title: Development release
289 files: /tmp/artifacts/**/*.(deb|rpm|exe)
290 if: startsWith(github.ref, 'refs/heads/')
292 - name: Publish packages (release)
293 uses: softprops/action-gh-release@v1
296 /tmp/artifacts/**/*.deb
297 /tmp/artifacts/**/*.rpm
298 /tmp/artifacts/**/*.exe
299 if: startsWith(github.ref, 'refs/tags/')
306 - name: Checkout code
307 uses: actions/checkout@v1
309 - name: Install build deps
312 - name: Run tests with default settings
313 run: sh .ci/test/run.sh default
315 - name: Run tests without legacy protocol
316 run: sh .ci/test/run.sh nolegacy
319 - name: Run tests with libgcrypt
320 run: sh .ci/test/run.sh gcrypt
323 - name: Upload test results
324 uses: actions/upload-artifact@v2
327 path: /tmp/logs/tests.*.tar.gz
331 runs-on: windows-latest
335 - name: Install msys2
336 uses: msys2/setup-msys2@v2
339 # https://packages.msys2.org/package/
342 mingw-w64-x86_64-meson
343 mingw-w64-x86_64-pkgconf
345 mingw-w64-x86_64-openssl
346 mingw-w64-x86_64-libgcrypt
347 mingw-w64-x86_64-zlib
348 mingw-w64-x86_64-lzo2
350 mingw-w64-x86_64-ncurses
351 mingw-w64-x86_64-miniupnpc
352 mingw-w64-x86_64-nsis
357 - name: Checkout code
358 uses: actions/checkout@v1
360 - name: Run tests with default settings
362 run: sh .ci/test/run.sh default
364 - name: Create installer
366 run: sh .ci/package/build.sh
367 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
368 continue-on-error: true
370 - name: Upload package
371 uses: actions/upload-artifact@v2
374 path: .ci/package/win/tinc-*.exe
375 continue-on-error: true
377 - name: Run tests without legacy protocol
379 run: sh .ci/test/run.sh nolegacy
382 - name: Run tests with libgcrypt
384 run: sh .ci/test/run.sh gcrypt
387 - name: Upload test results
388 uses: actions/upload-artifact@v2
391 path: /tmp/logs/tests.*.tar.gz
395 runs-on: windows-latest
402 - { build: amd64, host: amd64, test: test }
403 - { build: amd64, host: x86, test: test }
404 - { build: amd64, host: arm64, test: notest }
407 HOST_ARCH: ${{ matrix.target.host }}
408 BUILD_ARCH: ${{ matrix.target.build }}
411 - name: Install meson
412 run: pip3 install meson
414 - name: Checkout code
415 uses: actions/checkout@v1
417 - name: Activate dev environment
418 uses: ilammy/msvc-dev-cmd@v1
420 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
422 - name: Build (nolegacy)
423 run: .ci\windows\build.cmd nolegacy
425 - name: Test (nolegacy)
426 run: .ci\windows\test.cmd nolegacy
427 if: always() && matrix.target.test == 'test'
429 - name: Build (OpenSSL)
430 run: .ci\windows\build.cmd openssl
433 - name: Test (OpenSSL)
434 run: .ci\windows\test.cmd openssl
435 if: always() && matrix.target.test == 'test'