12 runs-on: ubuntu-latest
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
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
190 - name: Upload test results
191 uses: actions/upload-artifact@v2
193 name: tests_${{ env.ARTIFACT }}
194 path: /tmp/logs/tests.*.tar.gz
197 - name: Build package
198 run: sh .ci/package/build.sh
199 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
201 - name: Upload package
202 uses: actions/upload-artifact@v2
204 name: pkg-${{ env.ARTIFACT }}
207 ~/rpmbuild/RPMS/*/*.rpm
210 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
211 runs-on: ubuntu-latest
217 - name: Create artifact directory
218 run: mkdir -p /tmp/artifacts
220 - name: Download packages
221 uses: actions/download-artifact@v2
225 - name: Publish packages (dev)
226 uses: marvinpinto/action-automatic-releases@latest
228 repo_token: ${{ secrets.GITHUB_TOKEN }}
229 automatic_release_tag: latest
230 title: Development release
232 files: /tmp/artifacts/**/*.(deb|rpm|exe)
233 if: startsWith(github.ref, 'refs/heads/')
235 - name: Publish packages (release)
236 uses: softprops/action-gh-release@v1
239 /tmp/artifacts/**/*.deb
240 /tmp/artifacts/**/*.rpm
241 /tmp/artifacts/**/*.exe
242 if: startsWith(github.ref, 'refs/tags/')
245 runs-on: macos-latest
249 - name: Checkout code
250 uses: actions/checkout@v1
252 - name: Install build deps
255 - name: Run tests with default settings
256 run: sh .ci/test/run.sh default
258 - name: Run clang-tidy
260 export PATH="$PATH:$(brew --prefix llvm)/bin:$HOME/Library/Python/3.9/bin"
263 - name: Run tests without legacy protocol
264 run: sh .ci/test/run.sh nolegacy
266 - name: Upload test results
267 uses: actions/upload-artifact@v2
270 path: /tmp/logs/tests.*.tar.gz
274 runs-on: windows-latest
278 - name: Install msys2
279 uses: msys2/setup-msys2@v2
282 # https://packages.msys2.org/package/
286 mingw-w64-x86_64-openssl
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-')
309 - name: Upload package
310 uses: actions/upload-artifact@v2
313 path: .ci/package/win/tinc-*.exe
315 - name: Run tests without legacy protocol
317 run: sh .ci/test/run.sh nolegacy
319 - name: Upload test results
320 uses: actions/upload-artifact@v2
323 path: /tmp/logs/tests.*.tar.gz