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
63 uses: actions/checkout@v3
67 - name: Install dependencies
68 run: sudo SKIP_OPENSSL3=1 .ci/deps.sh autoconf automake iperf3
70 - name: Compatibility with older versions of tinc
71 run: sudo ./.ci/compat/run.sh
76 sudo apt-get install -y astyle clang-tidy-$CLANG
77 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
78 sudo update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-$CLANG 100
79 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
80 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
81 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
82 chmod 755 ~/shfmt ~/shellcheck
83 python3 -m venv /tmp/venv
84 . /tmp/venv/bin/activate
85 pip3 install black pylint mypy
92 - name: Lint/typecheck/check formatting on C/shell/Python code
94 . /tmp/venv/bin/activate
95 PATH=$PATH:$HOME ./lint.py
98 - name: Check warnings (clang)
99 run: bash .ci/warn/run.sh
104 - name: Check warnings (gcc)
105 run: bash .ci/warn/run.sh
110 - name: Archive test results
111 run: sudo tar -caf tests.tar.gz /usr/local/etc
112 continue-on-error: true
115 - name: Upload test results
116 uses: actions/upload-artifact@v2
123 runs-on: ubuntu-22.04
133 SANITIZER: "${{ matrix.sanitizer }}"
136 - name: Checkout code
137 uses: actions/checkout@v1
142 sudo pip3 install --upgrade cryptography
144 - name: Run tests with OpenSSL 3
145 run: bash .ci/sanitizers/run.sh openssl3
148 - name: Sanitize tests with default settings
149 run: bash .ci/sanitizers/run.sh default
152 - name: Sanitize tests without legacy protocol
153 run: bash .ci/sanitizers/run.sh nolegacy
156 - name: Run tests with libgcrypt
157 run: bash .ci/sanitizers/run.sh gcrypt
160 - name: Upload test results
161 uses: actions/upload-artifact@v2
163 name: tests_sanitizer_${{ matrix.sanitizer }}
164 path: /tmp/logs/tests.*.tar.gz
168 runs-on: ubuntu-22.04
176 - centos:7 # aka RHEL 7
177 - almalinux:8 # aka RHEL 8
178 - almalinux:9 # aka RHEL 9
183 - ubuntu # current LTS
184 - ubuntu:rolling # latest
186 image: ${{ matrix.os }}
187 options: --privileged
191 - name: Checkout code
192 uses: actions/checkout@v1
197 - name: Assign name for test results artifact
198 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
200 - name: Create a non-privileged user
201 run: sh .ci/test/prepare.sh
203 - name: Run tests with OpenSSL 3
204 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
206 - name: Run tests with default settings
207 run: sudo -u build CI=1 sh .ci/test/run.sh default
210 - name: Run tests without legacy protocol
211 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
214 - name: Run tests with libgcrypt
215 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
218 - name: Upload test results
219 uses: actions/upload-artifact@v2
221 name: tests_${{ env.ARTIFACT }}
222 path: /tmp/logs/tests.*.tar.gz
225 - name: Build package
226 run: sh .ci/package/build.sh
227 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
228 continue-on-error: true
230 - name: Upload package
231 uses: actions/upload-artifact@v2
233 name: pkg-${{ env.ARTIFACT }}
236 ~/rpmbuild/RPMS/*/*.rpm
237 continue-on-error: true
240 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
241 runs-on: ubuntu-22.04
242 continue-on-error: true
248 - name: Create artifact directory
249 run: mkdir -p /tmp/artifacts
251 - name: Download packages
252 uses: actions/download-artifact@v2
256 - name: Publish packages (dev)
257 uses: marvinpinto/action-automatic-releases@latest
259 repo_token: ${{ secrets.GITHUB_TOKEN }}
260 automatic_release_tag: latest
261 title: Development release
263 files: /tmp/artifacts/**/*.(deb|rpm|exe)
264 if: startsWith(github.ref, 'refs/heads/')
266 - name: Publish packages (release)
267 uses: softprops/action-gh-release@v1
270 /tmp/artifacts/**/*.deb
271 /tmp/artifacts/**/*.rpm
272 /tmp/artifacts/**/*.exe
273 if: startsWith(github.ref, 'refs/tags/')
280 - name: Checkout code
281 uses: actions/checkout@v1
283 - name: Install build deps
286 - name: Run tests with default settings
287 run: sh .ci/test/run.sh default
289 - name: Run tests without legacy protocol
290 run: sh .ci/test/run.sh nolegacy
293 - name: Run tests with libgcrypt
294 run: sh .ci/test/run.sh gcrypt
297 - name: Upload test results
298 uses: actions/upload-artifact@v2
301 path: /tmp/logs/tests.*.tar.gz
305 runs-on: windows-latest
309 - name: Install msys2
310 uses: msys2/setup-msys2@v2
313 # https://packages.msys2.org/package/
316 mingw-w64-x86_64-meson
317 mingw-w64-x86_64-pkgconf
319 mingw-w64-x86_64-openssl
320 mingw-w64-x86_64-libgcrypt
321 mingw-w64-x86_64-zlib
322 mingw-w64-x86_64-lzo2
324 mingw-w64-x86_64-ncurses
325 mingw-w64-x86_64-miniupnpc
326 mingw-w64-x86_64-nsis
331 - name: Checkout code
332 uses: actions/checkout@v1
334 - name: Run tests with default settings
336 run: sh .ci/test/run.sh default
338 - name: Create installer
340 run: sh .ci/package/build.sh
341 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
342 continue-on-error: true
344 - name: Upload package
345 uses: actions/upload-artifact@v2
348 path: .ci/package/win/tinc-*.exe
349 continue-on-error: true
351 - name: Run tests without legacy protocol
353 run: sh .ci/test/run.sh nolegacy
356 - name: Run tests with libgcrypt
358 run: sh .ci/test/run.sh gcrypt
361 - name: Upload test results
362 uses: actions/upload-artifact@v2
365 path: /tmp/logs/tests.*.tar.gz
369 runs-on: windows-latest
376 - { build: amd64, host: amd64, test: test }
377 - { build: amd64, host: x86, test: test }
378 - { build: amd64, host: arm64, test: notest }
381 HOST_ARCH: ${{ matrix.target.host }}
382 BUILD_ARCH: ${{ matrix.target.build }}
385 - name: Install meson
386 run: pip3 install meson
388 - name: Checkout code
389 uses: actions/checkout@v1
391 - name: Activate dev environment
392 uses: ilammy/msvc-dev-cmd@v1
394 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
396 - name: Build (nolegacy)
397 run: .ci\windows\build.cmd nolegacy
399 - name: Test (nolegacy)
400 run: .ci\windows\test.cmd nolegacy
401 if: always() && matrix.target.test == 'test'
403 - name: Build (OpenSSL)
404 run: .ci\windows\build.cmd openssl
407 - name: Test (OpenSSL)
408 run: .ci\windows\test.cmd openssl
409 if: always() && matrix.target.test == 'test'