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
37 - name: Run tests with default settings
38 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh default
40 - name: Run tests without legacy protocol
41 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh nolegacy
43 - name: Upload test results
44 uses: actions/upload-artifact@v2
46 name: tests_cross_${{ env.ARTIFACT }}
47 path: /tmp/logs/tests.*.tar.gz
51 runs-on: ubuntu-latest
55 uses: actions/checkout@v1
59 sudo apt-get install -y astyle clang-tidy-$CLANG
60 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
61 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
62 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
63 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
64 chmod 755 ~/shfmt ~/shellcheck
65 pip3 install --user compiledb
72 run: sudo sh .ci/deps.sh
74 - name: Configure and compile
77 ./configure $(sh .ci/conf.sh)
79 - name: Run clang-tidy
80 run: sh .ci/tidy/run.sh
83 - name: Check code formatting
84 run: "! astyle -r --options=.astylerc --dry-run --formatted '*.c' '*.h' | grep '^Formatted'"
87 - name: Check scripts formatting
88 run: find -type f -regextype egrep -regex '.+\.(sh|sh\.in|test)$' -exec ~/shfmt -d -i 2 -s '{}' +
91 - name: Run static analysis on scripts
92 run: find -type f -regextype egrep -regex '.+\.sh(\.in)?$' -exec shellcheck -x '{}' +
95 - name: Run static analysis on tests
96 run: find -type f -name '*.test' -execdir shellcheck -x '{}' +
99 - name: Check warnings (gcc)
100 run: bash .ci/warn/run.sh
105 - name: Check warnings (clang)
106 run: bash .ci/warn/run.sh
112 runs-on: ubuntu-latest
122 SANITIZER: "${{ matrix.sanitizer }}"
125 - name: Checkout code
126 uses: actions/checkout@v1
129 run: sudo sh .ci/deps.sh
131 - name: Configure and compile
133 run: bash .ci/sanitizers/build.sh
138 run: bash .ci/sanitizers/run.sh
140 - name: Archive test results
141 run: sudo tar -c -z -f test-results.tar.gz test/ sanitizer/
144 - name: Upload test results
145 uses: actions/upload-artifact@v2
147 name: tests_sanitizer_${{ matrix.sanitizer }}
148 path: test-results.tar.gz
152 runs-on: ubuntu-latest
159 - centos:7 # aka RHEL 7
160 - almalinux:8 # aka RHEL 8
165 - ubuntu # current LTS
166 - ubuntu:rolling # latest
168 image: ${{ matrix.os }}
169 options: --privileged
173 - name: Checkout code
174 uses: actions/checkout@v1
179 - name: Assign name for test results artifact
180 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
182 - name: Create a non-privileged user
183 run: sh .ci/test/prepare.sh
185 - name: Run tests with default settings
186 run: sudo -u build CI=1 sh .ci/test/run.sh default
188 - name: Run tests without legacy protocol
189 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
191 - name: Upload test results
192 uses: actions/upload-artifact@v2
194 name: tests_${{ env.ARTIFACT }}
195 path: /tmp/logs/tests.*.tar.gz
198 - name: Build package
199 run: sh .ci/package/build.sh
200 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
202 - name: Upload package
203 uses: actions/upload-artifact@v2
205 name: pkg-${{ env.ARTIFACT }}
208 ~/rpmbuild/RPMS/*/*.rpm
211 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
212 runs-on: ubuntu-latest
218 - name: Create artifact directory
219 run: mkdir -p /tmp/artifacts
221 - name: Download packages
222 uses: actions/download-artifact@v2
226 - name: Publish packages (dev)
227 uses: marvinpinto/action-automatic-releases@latest
229 repo_token: ${{ secrets.GITHUB_TOKEN }}
230 automatic_release_tag: latest
231 title: Development release
233 files: /tmp/artifacts/**/*.(deb|rpm|exe)
234 if: startsWith(github.ref, 'refs/heads/')
236 - name: Publish packages (release)
237 uses: softprops/action-gh-release@v1
240 /tmp/artifacts/**/*.deb
241 /tmp/artifacts/**/*.rpm
242 /tmp/artifacts/**/*.exe
243 if: startsWith(github.ref, 'refs/tags/')
246 runs-on: macos-latest
250 - name: Checkout code
251 uses: actions/checkout@v1
253 - name: Install build deps
256 - name: Run tests with default settings
257 run: sh .ci/test/run.sh default
259 - name: Run clang-tidy
261 export PATH="$PATH:$(brew --prefix llvm)/bin:$HOME/Library/Python/3.9/bin"
264 - name: Run tests without legacy protocol
265 run: sh .ci/test/run.sh nolegacy
267 - name: Upload test results
268 uses: actions/upload-artifact@v2
271 path: /tmp/logs/tests.*.tar.gz
275 runs-on: windows-latest
279 - name: Install msys2
280 uses: msys2/setup-msys2@v2
283 # https://packages.msys2.org/package/
287 mingw-w64-x86_64-openssl
288 mingw-w64-x86_64-zlib
289 mingw-w64-x86_64-lzo2
291 mingw-w64-x86_64-ncurses
292 mingw-w64-x86_64-miniupnpc
293 mingw-w64-x86_64-nsis
298 - name: Checkout code
299 uses: actions/checkout@v1
301 - name: Run tests with default settings
303 run: sh .ci/test/run.sh default
305 - name: Create installer
307 run: sh .ci/package/build.sh
308 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
310 - name: Upload package
311 uses: actions/upload-artifact@v2
314 path: .ci/package/win/tinc-*.exe
316 - name: Run tests without legacy protocol
318 run: sh .ci/test/run.sh nolegacy
320 - name: Upload test results
321 uses: actions/upload-artifact@v2
324 path: /tmp/logs/tests.*.tar.gz