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-')
195 continue-on-error: true
197 - name: Upload package
198 uses: actions/upload-artifact@v2
200 name: pkg-${{ env.ARTIFACT }}
203 ~/rpmbuild/RPMS/*/*.rpm
204 continue-on-error: true
207 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
208 runs-on: ubuntu-latest
209 continue-on-error: true
215 - name: Create artifact directory
216 run: mkdir -p /tmp/artifacts
218 - name: Download packages
219 uses: actions/download-artifact@v2
223 - name: Publish packages (dev)
224 uses: marvinpinto/action-automatic-releases@latest
226 repo_token: ${{ secrets.GITHUB_TOKEN }}
227 automatic_release_tag: latest
228 title: Development release
230 files: /tmp/artifacts/**/*.(deb|rpm|exe)
231 if: startsWith(github.ref, 'refs/heads/')
233 - name: Publish packages (release)
234 uses: softprops/action-gh-release@v1
237 /tmp/artifacts/**/*.deb
238 /tmp/artifacts/**/*.rpm
239 /tmp/artifacts/**/*.exe
240 if: startsWith(github.ref, 'refs/tags/')
243 runs-on: macos-latest
247 - name: Checkout code
248 uses: actions/checkout@v1
250 - name: Install build deps
253 - name: Run tests with default settings
254 run: sh .ci/test/run.sh default
256 - name: Run tests without legacy protocol
257 run: sh .ci/test/run.sh nolegacy
260 - name: Run tests with libgcrypt
261 run: sh .ci/test/run.sh gcrypt
263 - name: Upload test results
264 uses: actions/upload-artifact@v2
267 path: /tmp/logs/tests.*.tar.gz
271 runs-on: windows-latest
275 - name: Install msys2
276 uses: msys2/setup-msys2@v2
279 # https://packages.msys2.org/package/
282 mingw-w64-x86_64-meson
283 mingw-w64-x86_64-pkgconf
285 mingw-w64-x86_64-openssl
286 mingw-w64-x86_64-libgcrypt
287 mingw-w64-x86_64-zlib
288 mingw-w64-x86_64-lzo2
290 mingw-w64-x86_64-ncurses
291 mingw-w64-x86_64-miniupnpc
292 mingw-w64-x86_64-nsis
297 - name: Checkout code
298 uses: actions/checkout@v1
300 - name: Run tests with default settings
302 run: sh .ci/test/run.sh default
304 - name: Create installer
306 run: sh .ci/package/build.sh
307 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
308 continue-on-error: true
310 - name: Upload package
311 uses: actions/upload-artifact@v2
314 path: .ci/package/win/tinc-*.exe
315 continue-on-error: true
317 - name: Run tests without legacy protocol
319 run: sh .ci/test/run.sh nolegacy
322 - name: Run tests with libgcrypt
324 run: sh .ci/test/run.sh gcrypt
326 - name: Upload test results
327 uses: actions/upload-artifact@v2
330 path: /tmp/logs/tests.*.tar.gz
334 runs-on: windows-latest
341 - { build: amd64, host: amd64, test: test }
342 - { build: amd64, host: x86, test: test }
343 - { build: amd64, host: arm64, test: notest }
346 HOST_ARCH: ${{ matrix.target.host }}
347 BUILD_ARCH: ${{ matrix.target.build }}
350 - name: Install meson
351 run: pip3 install meson
353 - name: Checkout code
354 uses: actions/checkout@v1
356 - name: Activate dev environment
357 uses: ilammy/msvc-dev-cmd@v1
359 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
361 - name: Build (nolegacy)
362 run: .ci\windows\build.cmd nolegacy
364 - name: Test (nolegacy)
365 run: .ci\windows\test.cmd nolegacy
366 if: always() && matrix.target.test == 'test'
368 - name: Build (OpenSSL)
369 run: .ci\windows\build.cmd openssl
372 - name: Test (OpenSSL)
373 run: .ci\windows\test.cmd openssl
374 if: always() && matrix.target.test == 'test'