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: Sanitize tests with default settings
137 run: bash .ci/sanitizers/run.sh default
139 - name: Sanitize tests without legacy protocol
140 run: bash .ci/sanitizers/run.sh nolegacy
143 - name: Upload test results
144 uses: actions/upload-artifact@v2
146 name: tests_${{ env.ARTIFACT }}
147 path: /tmp/logs/tests.*.tar.gz
151 runs-on: ubuntu-latest
158 - centos:7 # aka RHEL 7
159 - almalinux:8 # aka RHEL 8
164 - ubuntu # current LTS
165 - ubuntu:rolling # latest
167 image: ${{ matrix.os }}
168 options: --privileged
172 - name: Checkout code
173 uses: actions/checkout@v1
178 - name: Assign name for test results artifact
179 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
181 - name: Create a non-privileged user
182 run: sh .ci/test/prepare.sh
184 - name: Run tests with default settings
185 run: sudo -u build CI=1 sh .ci/test/run.sh default
187 - name: Run tests without legacy protocol
188 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
191 - name: Run tests with libgcrypt
192 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-')
205 - name: Upload package
206 uses: actions/upload-artifact@v2
208 name: pkg-${{ env.ARTIFACT }}
211 ~/rpmbuild/RPMS/*/*.rpm
214 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
215 runs-on: ubuntu-latest
221 - name: Create artifact directory
222 run: mkdir -p /tmp/artifacts
224 - name: Download packages
225 uses: actions/download-artifact@v2
229 - name: Publish packages (dev)
230 uses: marvinpinto/action-automatic-releases@latest
232 repo_token: ${{ secrets.GITHUB_TOKEN }}
233 automatic_release_tag: latest
234 title: Development release
236 files: /tmp/artifacts/**/*.(deb|rpm|exe)
237 if: startsWith(github.ref, 'refs/heads/')
239 - name: Publish packages (release)
240 uses: softprops/action-gh-release@v1
243 /tmp/artifacts/**/*.deb
244 /tmp/artifacts/**/*.rpm
245 /tmp/artifacts/**/*.exe
246 if: startsWith(github.ref, 'refs/tags/')
249 runs-on: macos-latest
253 - name: Checkout code
254 uses: actions/checkout@v1
256 - name: Install build deps
259 - name: Run tests with default settings
260 run: sh .ci/test/run.sh default
262 - name: Run clang-tidy
264 export PATH="$PATH:$(brew --prefix llvm)/bin:$HOME/Library/Python/3.9/bin"
267 - name: Run tests without legacy protocol
268 run: sh .ci/test/run.sh nolegacy
271 - name: Run tests with libgcrypt
272 run: sh .ci/test/run.sh gcrypt
274 - name: Upload test results
275 uses: actions/upload-artifact@v2
278 path: /tmp/logs/tests.*.tar.gz
282 runs-on: windows-latest
286 - name: Install msys2
287 uses: msys2/setup-msys2@v2
290 # https://packages.msys2.org/package/
294 mingw-w64-x86_64-openssl
295 mingw-w64-x86_64-libgcrypt
296 mingw-w64-x86_64-zlib
297 mingw-w64-x86_64-lzo2
299 mingw-w64-x86_64-ncurses
300 mingw-w64-x86_64-miniupnpc
301 mingw-w64-x86_64-nsis
306 - name: Checkout code
307 uses: actions/checkout@v1
309 - name: Run tests with default settings
311 run: sh .ci/test/run.sh default
313 - name: Create installer
315 run: sh .ci/package/build.sh
316 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
318 - name: Upload package
319 uses: actions/upload-artifact@v2
322 path: .ci/package/win/tinc-*.exe
324 - name: Run tests without legacy protocol
326 run: sh .ci/test/run.sh nolegacy
329 - name: Run tests with libgcrypt
331 run: sh .ci/test/run.sh gcrypt
333 - name: Upload test results
334 uses: actions/upload-artifact@v2
337 path: /tmp/logs/tests.*.tar.gz