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: Run tests with libgcrypt
44 run: sudo -u build CI=1 HOST=${{ matrix.arch }} sh .ci/test/run.sh gcrypt
46 - name: Upload test results
47 uses: actions/upload-artifact@v2
49 name: tests_cross_${{ env.ARTIFACT }}
50 path: /tmp/logs/tests.*.tar.gz
54 runs-on: ubuntu-latest
58 uses: actions/checkout@v1
62 sudo apt-get install -y astyle clang-tidy-$CLANG
63 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG 100
64 curl -OL "https://github.com/koalaman/shellcheck/releases/download/v$SHELLCHECK/shellcheck-v${SHELLCHECK}.linux.x86_64.tar.xz"
65 tar -C ~ --strip-components=1 --wildcards -xf ./shellcheck-*.tar.xz 'shellcheck-*/shellcheck'
66 curl -o ~/shfmt -L "https://github.com/mvdan/sh/releases/download/v$SHFMT/shfmt_v${SHFMT}_linux_amd64"
67 chmod 755 ~/shfmt ~/shellcheck
68 pip3 install --user compiledb
75 run: sudo sh .ci/deps.sh
77 - name: Configure and compile
80 ./configure $(sh .ci/conf.sh)
82 - name: Run clang-tidy
83 run: sh .ci/tidy/run.sh
86 - name: Check code formatting
87 run: "! astyle -r --options=.astylerc --dry-run --formatted '*.c' '*.h' | grep '^Formatted'"
90 - name: Check scripts formatting
91 run: find -type f -regextype egrep -regex '.+\.(sh|sh\.in|test)$' -exec ~/shfmt -d -i 2 -s '{}' +
94 - name: Run static analysis on scripts
95 run: find -type f -regextype egrep -regex '.+\.sh(\.in)?$' -exec shellcheck -x '{}' +
98 - name: Run static analysis on tests
99 run: find -type f -name '*.test' -execdir shellcheck -x '{}' +
102 - name: Check warnings (gcc)
103 run: bash .ci/warn/run.sh
108 - name: Check warnings (clang)
109 run: bash .ci/warn/run.sh
115 runs-on: ubuntu-latest
125 SANITIZER: "${{ matrix.sanitizer }}"
128 - name: Checkout code
129 uses: actions/checkout@v1
132 run: sudo sh .ci/deps.sh
134 - name: Configure and compile
136 run: bash .ci/sanitizers/build.sh
141 run: bash .ci/sanitizers/run.sh
143 - name: Archive test results
144 run: sudo tar -c -z -f test-results.tar.gz test/ sanitizer/
147 - name: Upload test results
148 uses: actions/upload-artifact@v2
150 name: tests_sanitizer_${{ matrix.sanitizer }}
151 path: test-results.tar.gz
155 runs-on: ubuntu-latest
162 - centos:7 # aka RHEL 7
163 - almalinux:8 # aka RHEL 8
168 - ubuntu # current LTS
169 - ubuntu:rolling # latest
171 image: ${{ matrix.os }}
172 options: --privileged
176 - name: Checkout code
177 uses: actions/checkout@v1
182 - name: Assign name for test results artifact
183 run: echo ARTIFACT="$(echo '${{ matrix.os }}' | sed 's|[:/]|_|g')" >>"$GITHUB_ENV"
185 - name: Create a non-privileged user
186 run: sh .ci/test/prepare.sh
188 - name: Run tests with default settings
189 run: sudo -u build CI=1 sh .ci/test/run.sh default
191 - name: Run tests without legacy protocol
192 run: sudo -u build CI=1 sh .ci/test/run.sh nolegacy
194 - name: Run tests with libgcrypt
195 run: sudo -u build CI=1 sh .ci/test/run.sh gcrypt
197 - name: Upload test results
198 uses: actions/upload-artifact@v2
200 name: tests_${{ env.ARTIFACT }}
201 path: /tmp/logs/tests.*.tar.gz
204 - name: Build package
205 run: sh .ci/package/build.sh
206 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
208 - name: Upload package
209 uses: actions/upload-artifact@v2
211 name: pkg-${{ env.ARTIFACT }}
214 ~/rpmbuild/RPMS/*/*.rpm
217 if: always() && (github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-'))
218 runs-on: ubuntu-latest
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 clang-tidy
267 export PATH="$PATH:$(brew --prefix llvm)/bin:$HOME/Library/Python/3.9/bin"
270 - name: Run tests without legacy protocol
271 run: sh .ci/test/run.sh nolegacy
273 - name: Run tests with libgcrypt
274 run: sh .ci/test/run.sh gcrypt
276 - name: Upload test results
277 uses: actions/upload-artifact@v2
280 path: /tmp/logs/tests.*.tar.gz
284 runs-on: windows-latest
288 - name: Install msys2
289 uses: msys2/setup-msys2@v2
292 # https://packages.msys2.org/package/
296 mingw-w64-x86_64-openssl
297 mingw-w64-x86_64-libgcrypt
298 mingw-w64-x86_64-zlib
299 mingw-w64-x86_64-lzo2
301 mingw-w64-x86_64-ncurses
302 mingw-w64-x86_64-miniupnpc
303 mingw-w64-x86_64-nsis
308 - name: Checkout code
309 uses: actions/checkout@v1
311 - name: Run tests with default settings
313 run: sh .ci/test/run.sh default
315 - name: Create installer
317 run: sh .ci/package/build.sh
318 if: github.ref == 'refs/heads/1.1' || startsWith(github.ref, 'refs/tags/release-')
320 - name: Upload package
321 uses: actions/upload-artifact@v2
324 path: .ci/package/win/tinc-*.exe
326 - name: Run tests without legacy protocol
328 run: sh .ci/test/run.sh nolegacy
330 - name: Run tests with libgcrypt
332 run: sh .ci/test/run.sh gcrypt
334 - name: Upload test results
335 uses: actions/upload-artifact@v2
338 path: /tmp/logs/tests.*.tar.gz