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
47 - name: Upload test results
48 uses: actions/upload-artifact@v2
50 name: tests_cross_${{ matrix.arch }}
51 path: /tmp/logs/tests.*.tar.gz
55 runs-on: ubuntu-latest
59 uses: actions/checkout@v1
63 sudo apt-get install -y astyle clang-tidy-$CLANG
64 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
65 sudo update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-$CLANG 100
66 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
67 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
68 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
69 chmod 755 ~/shfmt ~/shellcheck
70 python3 -m venv /tmp/venv
71 . /tmp/venv/bin/activate
72 pip3 install black pylint mypy
79 run: sudo SKIP_OPENSSL3=1 sh .ci/deps.sh
81 - name: Lint/typecheck/check formatting on C/shell/Python code
83 . /tmp/venv/bin/activate
84 PATH=$PATH:$HOME ./lint.py
87 - name: Check warnings (clang)
88 run: bash .ci/warn/run.sh
93 - name: Check warnings (gcc)
94 run: bash .ci/warn/run.sh
100 runs-on: ubuntu-latest
110 SANITIZER: "${{ matrix.sanitizer }}"
113 - name: Checkout code
114 uses: actions/checkout@v1
117 run: sudo sh .ci/deps.sh
119 - name: Run tests with OpenSSL 3
120 run: bash .ci/sanitizers/run.sh openssl3
123 - name: Sanitize tests with default settings
124 run: bash .ci/sanitizers/run.sh default
127 - name: Sanitize tests without legacy protocol
128 run: bash .ci/sanitizers/run.sh nolegacy
131 - name: Run tests with libgcrypt
132 run: bash .ci/sanitizers/run.sh gcrypt
135 - name: Upload test results
136 uses: actions/upload-artifact@v2
138 name: tests_sanitizer_${{ matrix.sanitizer }}
139 path: /tmp/logs/tests.*.tar.gz
143 runs-on: ubuntu-latest
151 - centos:7 # aka RHEL 7
152 - almalinux:8 # aka RHEL 8
153 - almalinux:9 # aka RHEL 9
158 - ubuntu # current LTS
159 - ubuntu:rolling # latest
161 image: ${{ matrix.os }}
162 options: --privileged
166 - name: Checkout code
167 uses: actions/checkout@v1
172 - name: Assign name for test results artifact
173 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
175 - name: Create a non-privileged user
176 run: sh .ci/test/prepare.sh
178 - name: Run tests with OpenSSL 3
179 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
181 - name: Run tests with default settings
182 run: sudo -u build CI=1 sh .ci/test/run.sh default
185 - name: Run tests without legacy protocol
186 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
189 - name: Run tests with libgcrypt
190 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-')
203 continue-on-error: true
205 - name: Upload package
206 uses: actions/upload-artifact@v2
208 name: pkg-${{ env.ARTIFACT }}
211 ~/rpmbuild/RPMS/*/*.rpm
212 continue-on-error: true
215 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
216 runs-on: ubuntu-latest
217 continue-on-error: true
223 - name: Create artifact directory
224 run: mkdir -p /tmp/artifacts
226 - name: Download packages
227 uses: actions/download-artifact@v2
231 - name: Publish packages (dev)
232 uses: marvinpinto/action-automatic-releases@latest
234 repo_token: ${{ secrets.GITHUB_TOKEN }}
235 automatic_release_tag: latest
236 title: Development release
238 files: /tmp/artifacts/**/*.(deb|rpm|exe)
239 if: startsWith(github.ref, 'refs/heads/')
241 - name: Publish packages (release)
242 uses: softprops/action-gh-release@v1
245 /tmp/artifacts/**/*.deb
246 /tmp/artifacts/**/*.rpm
247 /tmp/artifacts/**/*.exe
248 if: startsWith(github.ref, 'refs/tags/')
251 runs-on: macos-latest
255 - name: Checkout code
256 uses: actions/checkout@v1
258 - name: Install build deps
261 - name: Run tests with default settings
262 run: sh .ci/test/run.sh default
264 - name: Run tests without legacy protocol
265 run: sh .ci/test/run.sh nolegacy
268 - name: Run tests with libgcrypt
269 run: sh .ci/test/run.sh gcrypt
272 - name: Upload test results
273 uses: actions/upload-artifact@v2
276 path: /tmp/logs/tests.*.tar.gz
280 runs-on: windows-latest
284 - name: Install msys2
285 uses: msys2/setup-msys2@v2
288 # https://packages.msys2.org/package/
291 mingw-w64-x86_64-meson
292 mingw-w64-x86_64-pkgconf
294 mingw-w64-x86_64-openssl
295 mingw-w64-x86_64-libgcrypt
296 mingw-w64-x86_64-zlib
297 mingw-w64-x86_64-lzo2
299 mingw-w64-x86_64-ncurses
300 mingw-w64-x86_64-miniupnpc
301 mingw-w64-x86_64-nsis
306 - name: Checkout code
307 uses: actions/checkout@v1
309 - name: Run tests with default settings
311 run: sh .ci/test/run.sh default
313 - name: Create installer
315 run: sh .ci/package/build.sh
316 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
317 continue-on-error: true
319 - name: Upload package
320 uses: actions/upload-artifact@v2
323 path: .ci/package/win/tinc-*.exe
324 continue-on-error: true
326 - name: Run tests without legacy protocol
328 run: sh .ci/test/run.sh nolegacy
331 - name: Run tests with libgcrypt
333 run: sh .ci/test/run.sh gcrypt
336 - name: Upload test results
337 uses: actions/upload-artifact@v2
340 path: /tmp/logs/tests.*.tar.gz
344 runs-on: windows-latest
351 - { build: amd64, host: amd64, test: test }
352 - { build: amd64, host: x86, test: test }
353 - { build: amd64, host: arm64, test: notest }
356 HOST_ARCH: ${{ matrix.target.host }}
357 BUILD_ARCH: ${{ matrix.target.build }}
360 - name: Install meson
361 run: pip3 install meson
363 - name: Checkout code
364 uses: actions/checkout@v1
366 - name: Activate dev environment
367 uses: ilammy/msvc-dev-cmd@v1
369 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
371 - name: Build (nolegacy)
372 run: .ci\windows\build.cmd nolegacy
374 - name: Test (nolegacy)
375 run: .ci\windows\test.cmd nolegacy
376 if: always() && matrix.target.test == 'test'
378 - name: Build (OpenSSL)
379 run: .ci\windows\build.cmd openssl
382 - name: Test (OpenSSL)
383 run: .ci\windows\test.cmd openssl
384 if: always() && matrix.target.test == 'test'