-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (47 loc) · 1.42 KB
/
ci.yml
File metadata and controls
50 lines (47 loc) · 1.42 KB
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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: extractions/setup-just@v3
- uses: harehare/setup-mq@v1
- uses: Swatinem/rust-cache@v2
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: nextest,cargo-llvm-cov
- name: Build
run: just build
- name: Run tests
run: just test
env:
NEXTEST_RETRIES: 3
- name: Check docs
run: just docs
- name: Check for diffs in docs
run: |
if [[ -n $(git status --porcelain docs/) ]]; then
echo "Error: Changes detected in docs directory. Please commit these changes."
git status --porcelain docs/
exit 1
fi
- name: Generate code coverage
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info
fail_ci_if_error: true