-
Notifications
You must be signed in to change notification settings - Fork 68
251 lines (214 loc) · 9.05 KB
/
rust-ci.yaml
File metadata and controls
251 lines (214 loc) · 9.05 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# This is mostly copied from the rust-analyzer repo
# https://github.com/rust-lang/rust-analyzer/blob/12e7aa3132217cc6a6c1151d468be35d7b365999/.github/workflows/ci.yaml
name: Rust CI
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
merge_group:
push:
branches:
- main
- 'support/**'
schedule:
# three times a day to run the integration tests that take a long time
- cron: '33 3,10,15 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CI: 1
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
RUST_CHANNEL: '1.91.1'
CARGO_DENY_VERSION: '0.19.0'
jobs:
rust:
name: Rust CI
timeout-minutes: 20
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./
#permissions:
#contents: read
#actions: read
#pull-requests: read
strategy:
fail-fast: false
matrix:
os: ["runs-on=${{ github.run_id }}/runner=8cpu-linux-x64/extras=s3-cache", "runs-on=${{ github.run_id }}/runner=4cpu-linux-arm64/extras=s3-cache", macos-15-intel, macos-latest]
steps:
- uses: runs-on/action@742bf56072eb4845a0f94b3394673e4903c90ff0 # v2
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check if MSRV is up to date
run: |
set -e
grep 'rust-version = "${{ env.RUST_CHANNEL }}"' Cargo.toml
# shellcheck disable=SC2016
grep 'The current MSRV is `${{ env.RUST_CHANNEL }}`' icechunk-python/docs/docs/reference/contributing.md
- name: Stand up docker services
if: contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')
run: |
docker compose up -d
- name: Wait for containers to be ready
if: contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')
run: |
for _ in {1..30}; do
if docker compose ps --status exited --filter status==0 | grep rustfs ; then
break
fi
sleep 1
done
for _ in {1..60}; do
if curl --silent --fail "http://localhost:10000/devstoreaccount1/testcontainer?sv=2023-01-03&ss=btqf&srt=sco&spr=https%2Chttp&st=2025-01-06T14%3A53%3A30Z&se=2035-01-07T14%3A53%3A00Z&sp=rwdftlacup&sig=jclETGilOzONYp4Y0iK9SpVRLGyehaS5lg5booJ9VYA%3D&restype=container"; then
break
fi
sleep 1
done
- name: Install Just
if: contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')
uses: taiki-e/install-action@98ec31d284eb962f41c14065e9391a955aa810cf # v2
with:
tool: just
- name: Install cargo nextest
uses: taiki-e/install-action@98ec31d284eb962f41c14065e9391a955aa810cf # nextest
- name: Install Rust toolchain
run: |
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src clippy
rustup default ${{ env.RUST_CHANNEL }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
with:
# workspaces: "rust -> target"
key: ${{ env.RUST_CHANNEL }}
- name: Run tests with Docker services
if: contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')
env:
RUST_LOG: icechunk=trace
R2_BUCKET: ${{ secrets.R2_BUCKET }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TIGRIS_BUCKET: ${{ secrets.TIGRIS_BUCKET }}
TIGRIS_REGION: ${{ secrets.TIGRIS_REGION }}
TIGRIS_ACCESS_KEY_ID: ${{ secrets.TIGRIS_ACCESS_KEY_ID }}
TIGRIS_SECRET_ACCESS_KEY: ${{ secrets.TIGRIS_SECRET_ACCESS_KEY }}
run: |
just profile=ci compile-tests "--locked"
just profile=ci test
- name: Run doc tests
if: contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')
run: |
just profile=ci doctest
- name: Run examples
if: contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')
run: |
just profile=ci run-all-examples
- name: Run unit tests only
if: ${{ !contains(matrix.os, 'linux') && !contains(matrix.os, 'ubuntu') }}
run: |
cargo test --lib --profile ci
- name: Run integration tests against object stores
if: github.event_name == 'cron'
env:
R2_BUCKET: ${{ secrets.R2_BUCKET }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TIGRIS_BUCKET: ${{ secrets.TIGRIS_BUCKET }}
TIGRIS_REGION: ${{ secrets.TIGRIS_REGION }}
TIGRIS_ACCESS_KEY_ID: ${{ secrets.TIGRIS_ACCESS_KEY_ID }}
TIGRIS_SECRET_ACCESS_KEY: ${{ secrets.TIGRIS_SECRET_ACCESS_KEY }}
run: |
cargo test --profile ci --workspace --all-targets -- --ignored
# shuttle:
# name: Shuttle concurrency tests
# timeout-minutes: 30
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# - name: Install Rust toolchain
# run: |
# rustup update --no-self-update ${{ env.RUST_CHANNEL }}
# rustup default ${{ env.RUST_CHANNEL }}
# - name: Cache Dependencies
# uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
# with:
# key: shuttle-${{ env.RUST_CHANNEL }}
# - name: Compile shuttle tests
# run: cargo test -p icechunk --features shuttle --test test_shuttle --no-run
# - name: Run shuttle tests
# run: cargo test -p icechunk --features shuttle --test test_shuttle -- --nocapture
wasm-build:
name: WASM Build
timeout-minutes: 15
runs-on: runs-on=${{ github.run_id }}/runner=8cpu-linux-x64/extras=s3-cache
defaults:
run:
working-directory: ./
env:
# Keep this as a compile smoke test; avoid failing on existing warnings in
# no-default-features wasm cfg combinations.
RUSTFLAGS: ""
steps:
- uses: runs-on/action@742bf56072eb4845a0f94b3394673e4903c90ff0 # v2
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Rust toolchain
run: |
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
rustup target add wasm32-wasip1-threads
- name: Install LLVM toolchain for wasm C deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang llvm wasi-libc libc++-dev
- name: Show wasm clang include search paths
run: |
echo | clang --target=wasm32-wasi -E -x c - -v
echo '#include <limits.h>' | clang --target=wasm32-wasi -E -x c - -v > /dev/null
ls -la /usr/include/wasm32-wasi || true
ls -la /usr/lib/wasm32-wasi || true
test -f /usr/include/wasm32-wasi/limits.h && echo "found /usr/include/wasm32-wasi/limits.h"
- name: Cache Dependencies
uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
with:
key: wasm-${{ env.RUST_CHANNEL }}
- name: Run wasm build check
env:
CC_wasm32_wasip1_threads: clang
CXX_wasm32_wasip1_threads: clang++
AR_wasm32_wasip1_threads: llvm-ar
CC_wasm32_wasi: clang
CXX_wasm32_wasi: clang++
AR_wasm32_wasi: llvm-ar
WASI_SYSROOT: /usr
CFLAGS_wasm32_wasip1_threads: --sysroot=/usr -isystem /usr/include/wasm32-wasi
CXXFLAGS_wasm32_wasip1_threads: --sysroot=/usr -isystem /usr/include/wasm32-wasi
CFLAGS_wasm32_wasi: --sysroot=/usr -isystem /usr/include/wasm32-wasi
CXXFLAGS_wasm32_wasi: --sysroot=/usr -isystem /usr/include/wasm32-wasi
run: |
cargo build -p icechunk --no-default-features --target wasm32-wasip1-threads
- name: Run no-default-features lib tests (proxy for wasm feature set)
run: |
cargo test -p icechunk --no-default-features --lib