-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (79 loc) · 2.54 KB
/
ci.yml
File metadata and controls
84 lines (79 loc) · 2.54 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
os:
description: 'OS to run tests on'
required: false
default: 'ubuntu-latest'
type: choice
options:
- ubuntu-latest
- macos-latest
- windows-latest
- all
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
os: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.os == 'all' && fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]') || fromJSON(format('["{0}"]', github.event.inputs.os))) || fromJSON('["ubuntu-latest"]') }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: extractions/setup-just@v3
- uses: harehare/setup-mq@v1
with:
bins: docs
- 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: Configure RUSTFLAGS for Windows
if: runner.os == 'Windows'
shell: bash
run: |
echo "RUSTFLAGS=${RUSTFLAGS} -C link-args=/STACK:8388608" >> $GITHUB_ENV
- name: Run tests
run: just test
env:
NEXTEST_RETRIES: 3
- name: Check docs
if: runner.os != 'Windows'
run: just docs
- name: Check for diffs in docs
if: runner.os != 'Windows'
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' && matrix.os == 'ubuntu-latest'
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' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info
fail_ci_if_error: true
check-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check bans licenses sources