4 group: test-${{ github.head_ref }}
5 cancel-in-progress: true
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:stable-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
167 sudo sh .ci/deps.sh iputils-arping
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
211 image: ${{ matrix.os }}
212 options: --privileged
216 - name: Checkout code
217 uses: actions/checkout@v1
222 - name: Assign name for test results artifact
223 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
225 - name: Create a non-privileged user
226 run: sh .ci/test/prepare.sh
228 - name: Run tests with OpenSSL 3
229 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
231 - name: Run tests with default settings
232 run: sudo -u build CI=1 sh .ci/test/run.sh default
235 - name: Run tests without legacy protocol
236 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
239 - name: Run tests with libgcrypt
240 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
243 - name: Upload test results
244 uses: actions/upload-artifact@v2
246 name: tests_${{ env.ARTIFACT }}
247 path: /tmp/logs/tests.*.tar.gz
250 - name: Build package
251 run: sh .ci/package/build.sh
252 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
253 continue-on-error: true
255 - name: Upload package
256 uses: actions/upload-artifact@v2
258 name: pkg-${{ env.ARTIFACT }}
261 ~/rpmbuild/RPMS/*/*.rpm
262 continue-on-error: true
265 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
266 runs-on: ubuntu-22.04
267 continue-on-error: true
273 - name: Create artifact directory
274 run: mkdir -p /tmp/artifacts
276 - name: Download packages
277 uses: actions/download-artifact@v2
281 - name: Publish packages (dev)
282 uses: marvinpinto/action-automatic-releases@latest
284 repo_token: ${{ secrets.GITHUB_TOKEN }}
285 automatic_release_tag: latest
286 title: Development release
288 files: /tmp/artifacts/**/*.(deb|rpm|exe)
289 if: startsWith(github.ref, 'refs/heads/')
291 - name: Publish packages (release)
292 uses: softprops/action-gh-release@v1
295 /tmp/artifacts/**/*.deb
296 /tmp/artifacts/**/*.rpm
297 /tmp/artifacts/**/*.exe
298 if: startsWith(github.ref, 'refs/tags/')
305 - name: Checkout code
306 uses: actions/checkout@v1
308 - name: Install build deps
311 - name: Run tests with default settings
312 run: sh .ci/test/run.sh default
314 - name: Run tests without legacy protocol
315 run: sh .ci/test/run.sh nolegacy
318 - name: Run tests with libgcrypt
319 run: sh .ci/test/run.sh gcrypt
322 - name: Upload test results
323 uses: actions/upload-artifact@v2
326 path: /tmp/logs/tests.*.tar.gz
330 runs-on: windows-latest
334 - name: Install msys2
335 uses: msys2/setup-msys2@v2
338 # https://packages.msys2.org/package/
341 mingw-w64-x86_64-meson
342 mingw-w64-x86_64-pkgconf
344 mingw-w64-x86_64-openssl
345 mingw-w64-x86_64-libgcrypt
346 mingw-w64-x86_64-zlib
347 mingw-w64-x86_64-lzo2
349 mingw-w64-x86_64-ncurses
350 mingw-w64-x86_64-miniupnpc
351 mingw-w64-x86_64-nsis
356 - name: Checkout code
357 uses: actions/checkout@v1
359 - name: Run tests with default settings
361 run: sh .ci/test/run.sh default
363 - name: Create installer
365 run: sh .ci/package/build.sh
366 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
367 continue-on-error: true
369 - name: Upload package
370 uses: actions/upload-artifact@v2
373 path: .ci/package/win/tinc-*.exe
374 continue-on-error: true
376 - name: Run tests without legacy protocol
378 run: sh .ci/test/run.sh nolegacy
381 - name: Run tests with libgcrypt
383 run: sh .ci/test/run.sh gcrypt
386 - name: Upload test results
387 uses: actions/upload-artifact@v2
390 path: /tmp/logs/tests.*.tar.gz
394 runs-on: windows-latest
401 - { build: amd64, host: amd64, test: test }
402 - { build: amd64, host: x86, test: test }
403 - { build: amd64, host: arm64, test: notest }
406 HOST_ARCH: ${{ matrix.target.host }}
407 BUILD_ARCH: ${{ matrix.target.build }}
410 - name: Install meson
411 run: pip3 install meson
413 - name: Checkout code
414 uses: actions/checkout@v1
416 - name: Activate dev environment
417 uses: ilammy/msvc-dev-cmd@v1
419 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
421 - name: Build (nolegacy)
422 run: .ci\windows\build.cmd nolegacy
424 - name: Test (nolegacy)
425 run: .ci\windows\test.cmd nolegacy
426 if: always() && matrix.target.test == 'test'
428 - name: Build (OpenSSL)
429 run: .ci\windows\build.cmd openssl
432 - name: Test (OpenSSL)
433 run: .ci\windows\test.cmd openssl
434 if: always() && matrix.target.test == 'test'