-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.35 KB
/
ci.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CI
on:
push:
branches:
- main
paths-ignore:
- '**/README.md'
pull_request:
branches:
- main
paths-ignore:
- '**/README.md'
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: "-Dwarnings"
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test --all-targets --all-features
- name: Lint
run: cargo clippy --all-targets --all-features
coverage:
runs-on: ubuntu-latest
needs: build_and_test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin
- uses: Swatinem/rust-cache@v2
- name: Generate code coverage
run: cargo tarpaulin --all-targets --all-features --timeout 120 --out xml --skip-clean --target-dir target/tarpaulin
- name: Upload to coveralls.io
uses: coverallsapp/github-action@v2
with:
fail-on-error: false
build_docker_image:
needs: build_and_test
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/docker-build.yml
permissions:
contents: read
packages: write