forked from delta-io/delta-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (140 loc) · 4.8 KB
/
build.yml
File metadata and controls
171 lines (140 loc) · 4.8 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
name: build
on:
push:
branches: [main, "rust-v*"]
pull_request:
branches: [main, "rust-v*", next, next/*]
merge_group:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
check:
runs-on: ubuntu-latest
env:
DEFAULT_FEATURES: "azure,datafusion,s3,gcs,glue,hdfs"
steps:
- uses: actions/checkout@v5
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt,clippy
cache: true
# if we ever get rid of all the clippy warnings, we can remove this line
rustflags: ""
- name: load DAT
run: make setup-dat
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
- name: build and lint with clippy
run: cargo clippy --profile=ci --features ${{ env.DEFAULT_FEATURES }} --tests
- name: Run Machete to check for unused dependencies
uses: bnjbvr/cargo-machete@aa070c61641e482bc2b5d41c97b496ee4755bf37
test-matrix:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.matrix.outputs.os }}
steps:
- name: Define test matrix
id: matrix
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT"
else
echo 'os=["ubuntu-latest", "windows-latest", "macos-latest"]' >> "$GITHUB_OUTPUT"
fi
build:
needs: test-matrix
strategy:
fail-fast: true
matrix:
os: ${{ fromJSON(needs.test-matrix.outputs.targets) }}
runs-on: ${{ matrix.os }}
env:
DEFAULT_FEATURES: "azure,datafusion,s3,gcs,glue,hdfs"
steps:
- uses: actions/checkout@v5
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
cache: true
# if we ever get rid of all the clippy warnings, we can remove this line
rustflags: ""
- name: Set up Python 3.13
if: matrix.os == 'windows-latest'
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Default build
run: cargo build --profile=ci --package deltalake
- name: Default features with clippy
run: cargo clippy --profile=ci --features ${{ env.DEFAULT_FEATURES }}
- name: Spot-check build for native-tls features
run: cargo build --profile=ci --no-default-features --features azure,datafusion,s3-native-tls,gcs,glue
- name: Check no default features (except rustls)
run: cargo check --profile=ci --no-default-features --features rustls
test:
name: Unit Tests
needs: test-matrix
strategy:
fail-fast: true
matrix:
os: ${{ fromJSON(needs.test-matrix.outputs.targets) }}
runs-on: ${{ matrix.os }}
env:
DEFAULT_FEATURES: "datafusion"
steps:
- uses: actions/checkout@v5
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
cache: true
# if we ever get rid of all the clippy warnings, we can remove this line
rustflags: ""
- name: Claim disk space
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo rm -rf /opt/microsoft || true # 783M
sudo rm -rf /usr/local/julia* || true # 1008M
sudo rm -rf /usr/local/share/chromium || true # 613M
sudo rm -rf /usr/local/share/powershell || true # 1244M
sudo rm -rf /usr/share/swift || true # 3207M
sudo df -TBG /
- name: Set up Python 3.13
if: matrix.os == 'windows-latest'
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests
shell: bash
run: |
make setup-dat
cargo llvm-cov --features ${{ env.DEFAULT_FEATURES }} \
--workspace \
--codecov \
--output-path codecov.json \
--exclude deltalake \
--exclude deltalake-azure \
--exclude deltalake-aws \
--exclude deltalake-hdfs \
--exclude deltalake-lakefs
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: codecov.json
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}