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
153 - centos:7 # aka RHEL 7
154 - almalinux:8 # aka RHEL 8
159 - ubuntu # current LTS
160 - ubuntu:rolling # latest
162 image: ${{ matrix.os }}
163 options: --privileged
167 - name: Checkout code
168 uses: actions/checkout@v1
173 - name: Assign name for test results artifact
174 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
176 - name: Create a non-privileged user
177 run: sh .ci/test/prepare.sh
179 - name: Run tests with OpenSSL 3
180 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
182 - name: Run tests with default settings
183 run: sudo -u build CI=1 sh .ci/test/run.sh default
186 - name: Run tests without legacy protocol
187 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
190 - name: Run tests with libgcrypt
191 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
194 - name: Upload test results
195 uses: actions/upload-artifact@v2
197 name: tests_${{ env.ARTIFACT }}
198 path: /tmp/logs/tests.*.tar.gz
201 - name: Build package
202 run: sh .ci/package/build.sh
203 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
204 continue-on-error: true
206 - name: Upload package
207 uses: actions/upload-artifact@v2
209 name: pkg-${{ env.ARTIFACT }}
212 ~/rpmbuild/RPMS/*/*.rpm
213 continue-on-error: true
216 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
217 runs-on: ubuntu-latest
218 continue-on-error: true
224 - name: Create artifact directory
225 run: mkdir -p /tmp/artifacts
227 - name: Download packages
228 uses: actions/download-artifact@v2
232 - name: Publish packages (dev)
233 uses: marvinpinto/action-automatic-releases@latest
235 repo_token: ${{ secrets.GITHUB_TOKEN }}
236 automatic_release_tag: latest
237 title: Development release
239 files: /tmp/artifacts/**/*.(deb|rpm|exe)
240 if: startsWith(github.ref, 'refs/heads/')
242 - name: Publish packages (release)
243 uses: softprops/action-gh-release@v1
246 /tmp/artifacts/**/*.deb
247 /tmp/artifacts/**/*.rpm
248 /tmp/artifacts/**/*.exe
249 if: startsWith(github.ref, 'refs/tags/')
252 runs-on: macos-latest
256 - name: Checkout code
257 uses: actions/checkout@v1
259 - name: Install build deps
262 - name: Run tests with default settings
263 run: sh .ci/test/run.sh default
265 - name: Run tests without legacy protocol
266 run: sh .ci/test/run.sh nolegacy
269 - name: Run tests with libgcrypt
270 run: sh .ci/test/run.sh gcrypt
273 - name: Upload test results
274 uses: actions/upload-artifact@v2
277 path: /tmp/logs/tests.*.tar.gz
281 runs-on: windows-latest
285 - name: Install msys2
286 uses: msys2/setup-msys2@v2
289 # https://packages.msys2.org/package/
292 mingw-w64-x86_64-meson
293 mingw-w64-x86_64-pkgconf
295 mingw-w64-x86_64-openssl
296 mingw-w64-x86_64-libgcrypt
297 mingw-w64-x86_64-zlib
298 mingw-w64-x86_64-lzo2
300 mingw-w64-x86_64-ncurses
301 mingw-w64-x86_64-miniupnpc
302 mingw-w64-x86_64-nsis
307 - name: Checkout code
308 uses: actions/checkout@v1
310 - name: Run tests with default settings
312 run: sh .ci/test/run.sh default
314 - name: Create installer
316 run: sh .ci/package/build.sh
317 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
318 continue-on-error: true
320 - name: Upload package
321 uses: actions/upload-artifact@v2
324 path: .ci/package/win/tinc-*.exe
325 continue-on-error: true
327 - name: Run tests without legacy protocol
329 run: sh .ci/test/run.sh nolegacy
332 - name: Run tests with libgcrypt
334 run: sh .ci/test/run.sh gcrypt
337 - name: Upload test results
338 uses: actions/upload-artifact@v2
341 path: /tmp/logs/tests.*.tar.gz
345 runs-on: windows-latest
352 - { build: amd64, host: amd64, test: test }
353 - { build: amd64, host: x86, test: test }
354 - { build: amd64, host: arm64, test: notest }
357 HOST_ARCH: ${{ matrix.target.host }}
358 BUILD_ARCH: ${{ matrix.target.build }}
361 - name: Install meson
362 run: pip3 install meson
364 - name: Checkout code
365 uses: actions/checkout@v1
367 - name: Activate dev environment
368 uses: ilammy/msvc-dev-cmd@v1
370 arch: ${{ matrix.target.build == matrix.target.host && matrix.target.host || format('{0}_{1}', matrix.target.build, matrix.target.host) }}
372 - name: Build (nolegacy)
373 run: .ci\windows\build.cmd nolegacy
375 - name: Test (nolegacy)
376 run: .ci\windows\test.cmd nolegacy
377 if: always() && matrix.target.test == 'test'
379 - name: Build (OpenSSL)
380 run: .ci\windows\build.cmd openssl
383 - name: Test (OpenSSL)
384 run: .ci\windows\test.cmd openssl
385 if: always() && matrix.target.test == 'test'