-
Notifications
You must be signed in to change notification settings - Fork 31
156 lines (143 loc) · 4.08 KB
/
rust.yml
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Rust
on:
pull_request:
paths:
- 'wren-core/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true
defaults:
run:
working-directory: wren-core
jobs:
# Check crate compiles
linux-build-lib:
name: cargo check
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-builder
with:
rust-version: stable
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./wren-core/target/
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache-benchmark-${{ hashFiles('wren-core/Cargo.toml') }}
- name: Check datafusion-common without default features
run: cargo check --all-targets
# Run tests
linux-test:
name: cargo test (amd64)
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-builder
with:
rust-version: stable
- name: Run tests (excluding doctests)
run: cargo test --lib --tests --bins
- name: Verify Working Directory Clean
run: git diff --exit-code
windows:
name: cargo test (win64)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-windows-builder
- name: Run tests (excluding doctests)
shell: bash
run: |
cargo test --lib --tests --bins
macos:
name: cargo test (macos)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-macos-builder
- name: Run tests (excluding doctests)
shell: bash
run: cargo test --lib --tests --bins
macos-aarch64:
name: cargo test (macos-aarch64)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-macos-aarch64-builder
- name: Run tests (excluding doctests)
shell: bash
run: cargo test --lib --tests --bins
check-fmt:
name: Check cargo fmt
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-builder
with:
rust-version: stable
- name: Run
run: cargo fmt --all -- --check
clippy:
name: clippy
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-builder
with:
rust-version: stable
- name: Install Clippy
run: rustup component add clippy
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
cargo-toml-formatting-checks:
name: check Cargo.toml formatting
needs: [ linux-build-lib ]
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/rust/setup-builder
with:
rust-version: stable
- name: Install taplo
run: cargo +stable install taplo-cli --version ^0.9 --locked
# if you encounter an error, try running 'taplo format' to fix the formatting automatically.
- name: Check Cargo.toml formatting
run: taplo format --check