12 runs-on: ubuntu-latest
22 image: debian:bullseye
27 uses: actions/checkout@v1
30 run: HOST=${{ matrix.arch }} sh .ci/deps.sh
32 - name: Prepare the system
34 sh .ci/test/prepare.sh
35 update-binfmts --enable
38 - name: Run tests with default settings
39 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh default
41 - name: Run tests without legacy protocol
42 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh nolegacy
45 - name: Run tests with libgcrypt
46 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh gcrypt
48 - name: Upload test results
49 uses: actions/upload-artifact@v2
51 name: tests_cross_${{ matrix.arch }}
52 path: /tmp/logs/tests.*.tar.gz
56 runs-on: ubuntu-latest
60 uses: actions/checkout@v1
64 sudo apt-get install -y astyle clang-tidy-$CLANG
65 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
66 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
67 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
68 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
69 chmod 755 ~/shfmt ~/shellcheck
70 pip3 install --user compiledb
77 run: sudo sh .ci/deps.sh
79 - name: Configure and compile
82 ./configure $(sh .ci/conf.sh)
84 - name: Run clang-tidy
85 run: sh .ci/tidy/run.sh
88 - name: Check code formatting
89 run: "! astyle -r --options=.astylerc --dry-run --formatted '*.c' '*.h' | grep '^Formatted'"
92 - name: Check scripts formatting
93 run: find -type f -regextype egrep -regex '.+\.(sh|sh\.in|test)$' -exec ~/shfmt -d -i 2 -s '{}' +
96 - name: Run static analysis on scripts
97 run: find -type f -regextype egrep -regex '.+\.sh(\.in)?$' -exec shellcheck -x '{}' +
100 - name: Run static analysis on tests
101 run: find -type f -name '*.test' -execdir shellcheck -x '{}' +
104 - name: Check warnings (gcc)
105 run: bash .ci/warn/run.sh
110 - name: Check warnings (clang)
111 run: bash .ci/warn/run.sh
117 runs-on: ubuntu-latest
127 SANITIZER: "${{ matrix.sanitizer }}"
130 - name: Checkout code
131 uses: actions/checkout@v1
134 run: sudo sh .ci/deps.sh
136 - name: Run tests with OpenSSL 3
137 run: bash .ci/sanitizers/run.sh openssl3
139 - name: Sanitize tests with default settings
140 run: bash .ci/sanitizers/run.sh default
142 - name: Sanitize tests without legacy protocol
143 run: bash .ci/sanitizers/run.sh nolegacy
146 - name: Upload test results
147 uses: actions/upload-artifact@v2
149 name: tests_sanitizer_${{ matrix.sanitizer }}
150 path: /tmp/logs/tests.*.tar.gz
154 runs-on: ubuntu-latest
161 - centos:7 # aka RHEL 7
162 - almalinux:8 # aka RHEL 8
167 - ubuntu # current LTS
168 - ubuntu:rolling # latest
170 image: ${{ matrix.os }}
171 options: --privileged
175 - name: Checkout code
176 uses: actions/checkout@v1
181 - name: Assign name for test results artifact
182 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
184 - name: Create a non-privileged user
185 run: sh .ci/test/prepare.sh
187 - name: Run tests with OpenSSL 3
188 run: sudo -u build CI=1 sh .ci/test/run.sh openssl3
190 - name: Run tests with default settings
191 run: sudo -u build CI=1 sh .ci/test/run.sh default
193 - name: Run tests without legacy protocol
194 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
197 - name: Run tests with libgcrypt
198 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
200 - name: Upload test results
201 uses: actions/upload-artifact@v2
203 name: tests_${{ env.ARTIFACT }}
204 path: /tmp/logs/tests.*.tar.gz
207 - name: Build package
208 run: sh .ci/package/build.sh
209 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
211 - name: Upload package
212 uses: actions/upload-artifact@v2
214 name: pkg-${{ env.ARTIFACT }}
217 ~/rpmbuild/RPMS/*/*.rpm
220 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
221 runs-on: ubuntu-latest
227 - name: Create artifact directory
228 run: mkdir -p /tmp/artifacts
230 - name: Download packages
231 uses: actions/download-artifact@v2
235 - name: Publish packages (dev)
236 uses: marvinpinto/action-automatic-releases@latest
238 repo_token: ${{ secrets.GITHUB_TOKEN }}
239 automatic_release_tag: latest
240 title: Development release
242 files: /tmp/artifacts/**/*.(deb|rpm|exe)
243 if: startsWith(github.ref, 'refs/heads/')
245 - name: Publish packages (release)
246 uses: softprops/action-gh-release@v1
249 /tmp/artifacts/**/*.deb
250 /tmp/artifacts/**/*.rpm
251 /tmp/artifacts/**/*.exe
252 if: startsWith(github.ref, 'refs/tags/')
255 runs-on: macos-latest
259 - name: Checkout code
260 uses: actions/checkout@v1
262 - name: Install build deps
265 - name: Run tests with default settings
266 run: sh .ci/test/run.sh default
268 - name: Run tests without legacy protocol
269 run: sh .ci/test/run.sh nolegacy
272 - name: Run tests with libgcrypt
273 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/
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-')
321 - name: Upload package
322 uses: actions/upload-artifact@v2
325 path: .ci/package/win/tinc-*.exe
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
336 - name: Upload test results
337 uses: actions/upload-artifact@v2
340 path: /tmp/logs/tests.*.tar.gz