-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (28 loc) · 1 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "dev" ]
env:
CARGO_TERM_COLOR: always
jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
prefix-key: "linux"
- name: Build, Test and Publish Coverage
run: |
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cargo-tarpaulin --force
cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120
else
echo "Code Coverage step is skipped on forks!"
cargo build --verbose --all-features
cargo test --verbose --all-features
fi