-
Notifications
You must be signed in to change notification settings - Fork 8
139 lines (111 loc) · 3.38 KB
/
cli-build-test.yaml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: 'CLI: Build and Test'
on:
workflow_dispatch:
pull_request:
paths:
- 'cli/**'
- 'lace/**'
- '.github/workflows/cli-build-test.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: . -> cli/target
- name: Install dependencies
run: cargo install cargo-hack
- name: Run cargo check on all features
working-directory: cli
run: cargo hack check --each-feature --all-targets
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: . -> cli/target
- name: Run rustfmt
working-directory: cli
run: cargo fmt --all -- --check
- name: Run clippy
working-directory: cli
env:
RUSTFLAGS: -C debuginfo=0
run: |
cargo clippy --all-features
- name: Install audit
run: cargo install cargo-audit
- name: Run audit
working-directory: cli
# Note: Both `polars` and `arrow2` trigger this security violation
# due to their reliance on `chrono`, which is the ultimate source of the violation
# as of 2/21/23, no version of `chrono` has been published that fixes the issue
# and thus neither `polars` or `arrow2` can pass `audit` checks
run: cargo audit -f Cargo.lock --ignore RUSTSEC-2020-0071
test:
runs-on: ${{ matrix.os }}
needs: ["lint", "features"]
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: . -> cli/target
- name: Regen Examples
env:
RUSTFLAGS: -C debuginfo=0
run: cargo run -- regen-examples
- name: Run tests
env:
RUSTFLAGS: -C debuginfo=0
run: cargo test
# semver-checks:
# runs-on: ubuntu-latest
# needs: ["features", "lint", "test"]
# steps:
# - name: Checkout branch
# uses: actions/checkout@v4
# with:
# path: branch
# - name: Checkout master
# uses: actions/checkout@v4
# with:
# ref: master
# path: master
# - name: Set up Rust
# uses: dtolnay/rust-toolchain@stable
# - name: Cache Rust
# uses: Swatinem/rust-cache@v2
# with:
# workspaces: . -> lace/target
# - name: Install extra cargo tools
# run: cargo install cargo-semver-checks --locked
# - name: Check for semver-incompatibilities
# run: cargo semver-checks check-release --manifest-path branch/lace/Cargo.toml --baseline-root master/lace --verbose