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 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
66 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
67 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
68 chmod 755 ~/shfmt ~/shellcheck
69 python3 -m venv /tmp/venv
70 . /tmp/venv/bin/activate
71 pip3 install black pylint mypy
78 run: sudo SKIP_OPENSSL3=1 sh .ci/deps.sh
80 - name: Lint/typecheck/check formatting on C/shell/Python code
82 . /tmp/venv/bin/activate
83 PATH=$PATH:$HOME ./lint.py
86 - name: Run clang-tidy
87 run: sh .ci/tidy/run.sh
90 - name: Check warnings (gcc)
91 run: bash .ci/warn/run.sh
96 - name: Check warnings (clang)
97 run: bash .ci/warn/run.sh
103 runs-on: ubuntu-latest
113 SANITIZER: "${{ matrix.sanitizer }}"
116 - name: Checkout code
117 uses: actions/checkout@v1
120 run: sudo sh .ci/deps.sh
122 - name: Run tests with OpenSSL 3
123 run: bash .ci/sanitizers/run.sh openssl3
126 - name: Sanitize tests with default settings
127 run: bash .ci/sanitizers/run.sh default
130 - name: Sanitize tests without legacy protocol
131 run: bash .ci/sanitizers/run.sh nolegacy
134 - name: Run tests with libgcrypt
135 run: bash .ci/sanitizers/run.sh gcrypt
138 - name: Upload test results
139 uses: actions/upload-artifact@v2
141 name: tests_sanitizer_${{ matrix.sanitizer }}
142 path: /tmp/logs/tests.*.tar.gz
146 runs-on: ubuntu-latest
154 - centos:7 # aka RHEL 7
155 - almalinux:8 # aka RHEL 8
156 - almalinux:9 # aka RHEL 9
161 - ubuntu # current LTS
162 - ubuntu:rolling # latest
164 image: ${{ matrix.os }}
165 options: --privileged
169 - name: Checkout code
170 uses: actions/checkout@v1
175 - name: Assign name for test results artifact
176 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
178 - name: Create a non-privileged user
179 run: sh .ci/test/prepare.sh
181 - name: Run tests with OpenSSL 3
182 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
184 - name: Run tests with default settings
185 run: sudo -u build CI=1 sh .ci/test/run.sh default
188 - name: Run tests without legacy protocol
189 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
192 - name: Run tests with libgcrypt
193 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
196 - name: Upload test results
197 uses: actions/upload-artifact@v2
199 name: tests_${{ env.ARTIFACT }}
200 path: /tmp/logs/tests.*.tar.gz
203 - name: Build package
204 run: sh .ci/package/build.sh
205 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
206 continue-on-error: true
208 - name: Upload package
209 uses: actions/upload-artifact@v2
211 name: pkg-${{ env.ARTIFACT }}
214 ~/rpmbuild/RPMS/*/*.rpm
215 continue-on-error: true
218 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
219 runs-on: ubuntu-latest
220 continue-on-error: true
226 - name: Create artifact directory
227 run: mkdir -p /tmp/artifacts
229 - name: Download packages
230 uses: actions/download-artifact@v2
234 - name: Publish packages (dev)
235 uses: marvinpinto/action-automatic-releases@latest
237 repo_token: ${{ secrets.GITHUB_TOKEN }}
238 automatic_release_tag: latest
239 title: Development release
241 files: /tmp/artifacts/**/*.(deb|rpm|exe)
242 if: startsWith(github.ref, 'refs/heads/')
244 - name: Publish packages (release)
245 uses: softprops/action-gh-release@v1
248 /tmp/artifacts/**/*.deb
249 /tmp/artifacts/**/*.rpm
250 /tmp/artifacts/**/*.exe
251 if: startsWith(github.ref, 'refs/tags/')
254 runs-on: macos-latest
258 - name: Checkout code
259 uses: actions/checkout@v1
261 - name: Install build deps
264 - name: Run tests with default settings
265 run: sh .ci/test/run.sh default
267 - name: Run tests without legacy protocol
268 run: sh .ci/test/run.sh nolegacy
271 - name: Run tests with libgcrypt
272 run: sh .ci/test/run.sh gcrypt
275 - name: Upload test results
276 uses: actions/upload-artifact@v2
279 path: /tmp/logs/tests.*.tar.gz
283 runs-on: windows-latest
287 - name: Install msys2
288 uses: msys2/setup-msys2@v2
291 # https://packages.msys2.org/package/
294 mingw-w64-x86_64-meson
295 mingw-w64-x86_64-pkgconf
297 mingw-w64-x86_64-openssl
298 mingw-w64-x86_64-libgcrypt
299 mingw-w64-x86_64-zlib
300 mingw-w64-x86_64-lzo2
302 mingw-w64-x86_64-ncurses
303 mingw-w64-x86_64-miniupnpc
304 mingw-w64-x86_64-nsis
309 - name: Checkout code
310 uses: actions/checkout@v1
312 - name: Run tests with default settings
314 run: sh .ci/test/run.sh default
316 - name: Create installer
318 run: sh .ci/package/build.sh
319 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
320 continue-on-error: true
322 - name: Upload package
323 uses: actions/upload-artifact@v2
326 path: .ci/package/win/tinc-*.exe
327 continue-on-error: true
329 - name: Run tests without legacy protocol
331 run: sh .ci/test/run.sh nolegacy
334 - name: Run tests with libgcrypt
336 run: sh .ci/test/run.sh gcrypt
339 - name: Upload test results
340 uses: actions/upload-artifact@v2
343 path: /tmp/logs/tests.*.tar.gz
347 runs-on: windows-latest
354 - { build: amd64, host: amd64, test: test }
355 - { build: amd64, host: x86, test: test }
356 - { build: amd64, host: arm64, test: notest }
359 HOST_ARCH: ${{ matrix.target.host }}
360 BUILD_ARCH: ${{ matrix.target.build }}
363 - name: Install meson
364 run: pip3 install meson
366 - name: Checkout code
367 uses: actions/checkout@v1
369 - name: Activate dev environment
370 uses: ilammy/msvc-dev-cmd@v1
372 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
374 - name: Build (nolegacy)
375 run: .ci\windows\build.cmd nolegacy
377 - name: Test (nolegacy)
378 run: .ci\windows\test.cmd nolegacy
379 if: always() && matrix.target.test == 'test'
381 - name: Build (OpenSSL)
382 run: .ci\windows\build.cmd openssl
385 - name: Test (OpenSSL)
386 run: .ci\windows\test.cmd openssl
387 if: always() && matrix.target.test == 'test'