forked from lynx-family/lynx-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (88 loc) · 2.79 KB
/
rust.yml
File metadata and controls
93 lines (88 loc) · 2.79 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
name: Rust
on:
push:
branches:
- main
workflow_call:
secrets:
CODECOV_TOKEN:
required: true
# Set minimum permissions to prevent unnecessary access
permissions: {}
env:
CI: 1
TURBO_TELEMETRY_DISABLED: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.runs-on.name }})
runs-on: ${{ matrix.runs-on.label }}
strategy:
matrix:
runs-on:
- label: lynx-ubuntu-24.04-xlarge
name: Ubuntu
# - label: lynx-windows-2022-large
# name: Windows
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
- uses: ./.github/actions/rustup
with:
key: test
save-if: ${{ github.ref_name == 'main' }}
- name: Install llvm-cov and nextest
uses: taiki-e/install-action@71b48393496777ee11188c07a34d48b048a985cd # v2
with:
tool: cargo-llvm-cov,cargo-nextest
- name: Test
env:
CARGO_LLVM_COV_FLAGS_NO_RUNNER: --no-sparse
run: |
cargo llvm-cov nextest --all-targets --all-features --profile ci --config-file .cargo/nextest.toml --lcov --output-path lcov.info --release
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/ci/test-report.junit.xml
rustfmt:
runs-on: lynx-ubuntu-24.04-medium
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
components: rustfmt
cache: false
- name: Format
run: cargo fmt --check
clippy:
runs-on: lynx-ubuntu-24.04-medium
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
components: clippy
cache: false
- name: Clippy
run: cargo clippy --tests --all-features -- -D warnings