-
Notifications
You must be signed in to change notification settings - Fork 49
98 lines (79 loc) · 2.41 KB
/
ci.yml
File metadata and controls
98 lines (79 loc) · 2.41 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
jobs:
build-test:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ macos, windows ]
steps:
- uses: actions/checkout@v6
- run: cargo build --all-targets --all-features
- run: cargo test
fmt-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install stable Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
components: clippy
toolchain: '1.88'
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
components: rustfmt
toolchain: 'nightly-2025-11-24'
- name: Rustfmt (nightly)
# Run nightly formatting to allow group imports
run: cargo +nightly-2025-11-24 fmt --all -- --check
- name: Clippy (All features)
run: cargo +1.88 clippy --all-targets --all-features -- -D warnings
- name: Clippy
run: cargo +1.88 clippy --all-targets -- -D warnings
cargo-sort:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install cargo-sort
uses: baptiste0928/cargo-install@v3
with:
crate: 'cargo-sort'
version: 'v2.0.2'
- name: Check Cargo.toml sorting
run: cargo sort --check
test-coverage:
name: build-test (ubuntu) with coverage
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install stable Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: '1.88'
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-llvm-cov
- name: Test with coverage
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
if: ${{ github.repository_owner == 'Polymarket' }}
with:
files: lcov.info
flags: rust
name: rust-llvm-cov
token: ${{ secrets.CODECOV_TOKEN }}