This repository was archived by the owner on Oct 27, 2026. It is now read-only.
Repository navigation
120 lines (114 loc) · 3.48 KB
/
Copy pathci.yml
File metadata and controls
120 lines (114 loc) · 3.48 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: ci
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
id-token: write
pull-requests: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
audit: ${{ steps.filter.outputs.audit }}
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v7.0.0
- uses: dorny/paths-filter@v4.0.3
id: filter
with:
filters: |
audit:
- '.github/workflows/ci.yml'
- 'Cargo.lock'
- 'Cargo.toml'
rust:
- '.github/workflows/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'build.rs'
- 'codecov.yml'
- 'release-dependencies.json'
- 'packaging/**'
- 'scripts/**'
- 'src/**'
- 'tests/**'
audit:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: changes
if: needs.changes.outputs.audit == 'true'
steps:
- uses: actions/checkout@v7.0.0
- uses: taiki-e/install-action@v2
with:
tool: cargo-audit@0.22.2
- name: Audit locked Rust dependencies
run: cargo audit --json > cargo-audit.json
- name: Upload Rust vulnerability report
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: agent-remote-cli-cargo-audit
path: cargo-audit.json
if-no-files-found: error
rust:
name: rust (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 25
needs: changes
if: needs.changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
test-threads: "6"
- os: macos-14
test-threads: "4"
- os: windows-latest
test-threads: "4"
steps:
- uses: actions/checkout@v7.0.0
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2.9.2
with:
key: ci-${{ matrix.os }}
cache-all-crates: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest@0.9.146
- name: Run static quality checks
if: matrix.os == 'ubuntu-latest'
shell: bash
run: scripts/run-static-checks.sh
- name: Run platform quality checks
if: matrix.os != 'ubuntu-latest'
shell: bash
run: scripts/run-quality-checks.sh
- name: Install cargo-llvm-cov
if: matrix.os == 'ubuntu-latest'
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate coverage report and test
if: matrix.os == 'ubuntu-latest'
run: |
cargo llvm-cov nextest --workspace --fail-under-lines 45 --lcov --output-path lcov.info --test-threads ${{ matrix.test-threads }} --no-fail-fast
cargo test --workspace --doc -- --test-threads ${{ matrix.test-threads }}
- name: Run tests (non-ubuntu)
if: matrix.os != 'ubuntu-latest'
run: cargo nextest run --workspace --test-threads ${{ matrix.test-threads }} --no-fail-fast
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v7.0.0
with:
disable_search: true
fail_ci_if_error: false
files: ./lcov.info
use_oidc: true