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
46 - name: Upload test results
47 uses: actions/upload-artifact@v2
49 name: tests_cross_${{ matrix.arch }}
50 path: /tmp/logs/tests.*.tar.gz
54 runs-on: ubuntu-latest
58 uses: actions/checkout@v1
62 sudo apt-get install -y astyle clang-tidy-$CLANG
63 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
64 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
65 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
66 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
67 chmod 755 ~/shfmt ~/shellcheck
68 python3 -m venv /tmp/venv
69 . /tmp/venv/bin/activate
70 pip3 install black pylint mypy
77 run: sudo SKIP_OPENSSL3=1 sh .ci/deps.sh
79 - name: Lint/typecheck/check formatting on C/shell/Python code
81 . /tmp/venv/bin/activate
82 PATH=$PATH:$HOME ./lint.py
85 - name: Run clang-tidy
86 run: sh .ci/tidy/run.sh
89 - name: Check warnings (gcc)
90 run: bash .ci/warn/run.sh
95 - name: Check warnings (clang)
96 run: bash .ci/warn/run.sh
102 runs-on: ubuntu-latest
112 SANITIZER: "${{ matrix.sanitizer }}"
115 - name: Checkout code
116 uses: actions/checkout@v1
119 run: sudo sh .ci/deps.sh
121 - name: Run tests with OpenSSL 3
122 run: bash .ci/sanitizers/run.sh openssl3
124 - name: Sanitize tests with default settings
125 run: bash .ci/sanitizers/run.sh default
127 - name: Sanitize tests without legacy protocol
128 run: bash .ci/sanitizers/run.sh nolegacy
131 - name: Upload test results
132 uses: actions/upload-artifact@v2
134 name: tests_sanitizer_${{ matrix.sanitizer }}
135 path: /tmp/logs/tests.*.tar.gz
139 runs-on: ubuntu-latest
146 - centos:7 # aka RHEL 7
147 - almalinux:8 # aka RHEL 8
152 - ubuntu # current LTS
153 - ubuntu:rolling # latest
155 image: ${{ matrix.os }}
156 options: --privileged
160 - name: Checkout code
161 uses: actions/checkout@v1
166 - name: Assign name for test results artifact
167 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
169 - name: Create a non-privileged user
170 run: sh .ci/test/prepare.sh
172 - name: Run tests with OpenSSL 3
173 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
175 - name: Run tests with default settings
176 run: sudo -u build CI=1 sh .ci/test/run.sh default
178 - name: Run tests without legacy protocol
179 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
182 - name: Run tests with libgcrypt
183 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
185 - name: Upload test results
186 uses: actions/upload-artifact@v2
188 name: tests_${{ env.ARTIFACT }}
189 path: /tmp/logs/tests.*.tar.gz
192 - name: Build package
193 run: sh .ci/package/build.sh
194 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
196 - name: Upload package
197 uses: actions/upload-artifact@v2
199 name: pkg-${{ env.ARTIFACT }}
202 ~/rpmbuild/RPMS/*/*.rpm
205 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
206 runs-on: ubuntu-latest
212 - name: Create artifact directory
213 run: mkdir -p /tmp/artifacts
215 - name: Download packages
216 uses: actions/download-artifact@v2
220 - name: Publish packages (dev)
221 uses: marvinpinto/action-automatic-releases@latest
223 repo_token: ${{ secrets.GITHUB_TOKEN }}
224 automatic_release_tag: latest
225 title: Development release
227 files: /tmp/artifacts/**/*.(deb|rpm|exe)
228 if: startsWith(github.ref, 'refs/heads/')
230 - name: Publish packages (release)
231 uses: softprops/action-gh-release@v1
234 /tmp/artifacts/**/*.deb
235 /tmp/artifacts/**/*.rpm
236 /tmp/artifacts/**/*.exe
237 if: startsWith(github.ref, 'refs/tags/')
240 runs-on: macos-latest
244 - name: Checkout code
245 uses: actions/checkout@v1
247 - name: Install build deps
250 - name: Run tests with default settings
251 run: sh .ci/test/run.sh default
253 - name: Run tests without legacy protocol
254 run: sh .ci/test/run.sh nolegacy
257 - name: Run tests with libgcrypt
258 run: sh .ci/test/run.sh gcrypt
260 - name: Upload test results
261 uses: actions/upload-artifact@v2
264 path: /tmp/logs/tests.*.tar.gz
268 runs-on: windows-latest
272 - name: Install msys2
273 uses: msys2/setup-msys2@v2
276 # https://packages.msys2.org/package/
279 mingw-w64-x86_64-meson
280 mingw-w64-x86_64-pkgconf
282 mingw-w64-x86_64-openssl
283 mingw-w64-x86_64-libgcrypt
284 mingw-w64-x86_64-zlib
285 mingw-w64-x86_64-lzo2
287 mingw-w64-x86_64-ncurses
288 mingw-w64-x86_64-miniupnpc
289 mingw-w64-x86_64-nsis
294 - name: Checkout code
295 uses: actions/checkout@v1
297 - name: Run tests with default settings
299 run: sh .ci/test/run.sh default
301 - name: Create installer
303 run: sh .ci/package/build.sh
304 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
306 - name: Upload package
307 uses: actions/upload-artifact@v2
310 path: .ci/package/win/tinc-*.exe
312 - name: Run tests without legacy protocol
314 run: sh .ci/test/run.sh nolegacy
317 - name: Run tests with libgcrypt
319 run: sh .ci/test/run.sh gcrypt
321 - name: Upload test results
322 uses: actions/upload-artifact@v2
325 path: /tmp/logs/tests.*.tar.gz
329 runs-on: windows-latest
336 - { build: amd64, host: amd64, test: test }
337 - { build: amd64, host: x86, test: test }
338 - { build: amd64, host: arm64, test: notest }
341 HOST_ARCH: ${{ matrix.target.host }}
342 BUILD_ARCH: ${{ matrix.target.build }}
345 - name: Install meson
346 run: pip3 install meson
348 - name: Checkout code
349 uses: actions/checkout@v1
351 - name: Activate dev environment
352 uses: ilammy/msvc-dev-cmd@v1
354 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
356 - name: Build (nolegacy)
357 run: .ci\windows\build.cmd nolegacy
359 - name: Test (nolegacy)
360 run: .ci\windows\test.cmd nolegacy
361 if: always() && matrix.target.test == 'test'
363 - name: Build (OpenSSL)
364 run: .ci\windows\build.cmd openssl
367 - name: Test (OpenSSL)
368 run: .ci\windows\test.cmd openssl
369 if: always() && matrix.target.test == 'test'