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
125 - name: Sanitize tests with default settings
126 run: bash .ci/sanitizers/run.sh default
129 - name: Sanitize tests without legacy protocol
130 run: bash .ci/sanitizers/run.sh nolegacy
133 - name: Upload test results
134 uses: actions/upload-artifact@v2
136 name: tests_sanitizer_${{ matrix.sanitizer }}
137 path: /tmp/logs/tests.*.tar.gz
141 runs-on: ubuntu-latest
148 - centos:7 # aka RHEL 7
149 - almalinux:8 # aka RHEL 8
154 - ubuntu # current LTS
155 - ubuntu:rolling # latest
157 image: ${{ matrix.os }}
158 options: --privileged
162 - name: Checkout code
163 uses: actions/checkout@v1
168 - name: Assign name for test results artifact
169 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
171 - name: Create a non-privileged user
172 run: sh .ci/test/prepare.sh
174 - name: Run tests with OpenSSL 3
175 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
177 - name: Run tests with default settings
178 run: sudo -u build CI=1 sh .ci/test/run.sh default
181 - name: Run tests without legacy protocol
182 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
185 - name: Run tests with libgcrypt
186 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
189 - name: Upload test results
190 uses: actions/upload-artifact@v2
192 name: tests_${{ env.ARTIFACT }}
193 path: /tmp/logs/tests.*.tar.gz
196 - name: Build package
197 run: sh .ci/package/build.sh
198 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
199 continue-on-error: true
201 - name: Upload package
202 uses: actions/upload-artifact@v2
204 name: pkg-${{ env.ARTIFACT }}
207 ~/rpmbuild/RPMS/*/*.rpm
208 continue-on-error: true
211 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
212 runs-on: ubuntu-latest
213 continue-on-error: true
219 - name: Create artifact directory
220 run: mkdir -p /tmp/artifacts
222 - name: Download packages
223 uses: actions/download-artifact@v2
227 - name: Publish packages (dev)
228 uses: marvinpinto/action-automatic-releases@latest
230 repo_token: ${{ secrets.GITHUB_TOKEN }}
231 automatic_release_tag: latest
232 title: Development release
234 files: /tmp/artifacts/**/*.(deb|rpm|exe)
235 if: startsWith(github.ref, 'refs/heads/')
237 - name: Publish packages (release)
238 uses: softprops/action-gh-release@v1
241 /tmp/artifacts/**/*.deb
242 /tmp/artifacts/**/*.rpm
243 /tmp/artifacts/**/*.exe
244 if: startsWith(github.ref, 'refs/tags/')
247 runs-on: macos-latest
251 - name: Checkout code
252 uses: actions/checkout@v1
254 - name: Install build deps
257 - name: Run tests with default settings
258 run: sh .ci/test/run.sh default
260 - name: Run tests without legacy protocol
261 run: sh .ci/test/run.sh nolegacy
264 - name: Run tests with libgcrypt
265 run: sh .ci/test/run.sh gcrypt
268 - name: Upload test results
269 uses: actions/upload-artifact@v2
272 path: /tmp/logs/tests.*.tar.gz
276 runs-on: windows-latest
280 - name: Install msys2
281 uses: msys2/setup-msys2@v2
284 # https://packages.msys2.org/package/
287 mingw-w64-x86_64-meson
288 mingw-w64-x86_64-pkgconf
290 mingw-w64-x86_64-openssl
291 mingw-w64-x86_64-libgcrypt
292 mingw-w64-x86_64-zlib
293 mingw-w64-x86_64-lzo2
295 mingw-w64-x86_64-ncurses
296 mingw-w64-x86_64-miniupnpc
297 mingw-w64-x86_64-nsis
302 - name: Checkout code
303 uses: actions/checkout@v1
305 - name: Run tests with default settings
307 run: sh .ci/test/run.sh default
309 - name: Create installer
311 run: sh .ci/package/build.sh
312 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
313 continue-on-error: true
315 - name: Upload package
316 uses: actions/upload-artifact@v2
319 path: .ci/package/win/tinc-*.exe
320 continue-on-error: true
322 - name: Run tests without legacy protocol
324 run: sh .ci/test/run.sh nolegacy
327 - name: Run tests with libgcrypt
329 run: sh .ci/test/run.sh gcrypt
332 - name: Upload test results
333 uses: actions/upload-artifact@v2
336 path: /tmp/logs/tests.*.tar.gz
340 runs-on: windows-latest
347 - { build: amd64, host: amd64, test: test }
348 - { build: amd64, host: x86, test: test }
349 - { build: amd64, host: arm64, test: notest }
352 HOST_ARCH: ${{ matrix.target.host }}
353 BUILD_ARCH: ${{ matrix.target.build }}
356 - name: Install meson
357 run: pip3 install meson
359 - name: Checkout code
360 uses: actions/checkout@v1
362 - name: Activate dev environment
363 uses: ilammy/msvc-dev-cmd@v1
365 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
367 - name: Build (nolegacy)
368 run: .ci\windows\build.cmd nolegacy
370 - name: Test (nolegacy)
371 run: .ci\windows\test.cmd nolegacy
372 if: always() && matrix.target.test == 'test'
374 - name: Build (OpenSSL)
375 run: .ci\windows\build.cmd openssl
378 - name: Test (OpenSSL)
379 run: .ci\windows\test.cmd openssl
380 if: always() && matrix.target.test == 'test'