Skip to content

Commit 96dcef5

Browse files
committed
update rustup
1 parent df653fb commit 96dcef5

File tree

4 files changed

+68
-123
lines changed

4 files changed

+68
-123
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
runs_on: [ 'ubuntu-22.04', 'ubuntu-22.04-arm' ]
2424
include:
2525
- runs_on: ubuntu-22.04
26-
arch: x64
26+
arch: x86_64
2727
- runs_on: ubuntu-22.04-arm
28-
arch: arm64
28+
arch: aarch64
2929

3030
runs-on: ${{ matrix.runs_on }}
3131

@@ -36,44 +36,28 @@ jobs:
3636
steps:
3737
- uses: actions/checkout@v4
3838

39-
- name: Set up sccache for x86_64
40-
if: ${{ matrix.arch == 'x64' }}
39+
- name: Set up sccache
4140
run: |
42-
wget https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz
43-
tar -xzf sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz
44-
sudo mv sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache /usr/local/bin
41+
wget https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/sccache-v$SCCACHE_VERSION-${{ matrix.arch }}-unknown-linux-musl.tar.gz
42+
tar -xzf sccache-v$SCCACHE_VERSION-${{ matrix.arch }}-unknown-linux-musl.tar.gz
43+
sudo mv sccache-v$SCCACHE_VERSION-${{ matrix.arch }}-unknown-linux-musl/sccache /usr/local/bin
4544
chmod +x /usr/local/bin/sccache
45+
if [ "${{ matrix.arch }}" == "x86_64" ]; then
46+
SCCACHE_SHA256=$SCCACHE_x86_64_SHA256
47+
else
48+
SCCACHE_SHA256=$SCCACHE_AARCH64_SHA256
49+
fi
4650
echo "$SCCACHE_SHA256 /usr/local/bin/sccache" | sha256sum --check
4751
env:
4852
SCCACHE_VERSION: 0.8.1
49-
SCCACHE_SHA256: "7203a4dcb3a67f3a0272366d50ede22e5faa3e2a798deaa4d1ea377b51c0ab0c"
53+
SCCACHE_x86_64_SHA256: "7203a4dcb3a67f3a0272366d50ede22e5faa3e2a798deaa4d1ea377b51c0ab0c"
54+
SCCACHE_AARCH64_SHA256: "36b2fd1c6c3a104ec1d526edb0533a3827c266054bf4552fb97f524beff6a612"
5055

51-
- name: Set up sccache for arm64
52-
if: ${{ matrix.arch == 'arm64' }}
53-
run: |
54-
wget https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/sccache-v$SCCACHE_VERSION-aarch64-unknown-linux-musl.tar.gz
55-
tar -xzf sccache-v$SCCACHE_VERSION-aarch64-unknown-linux-musl.tar.gz
56-
sudo mv sccache-v$SCCACHE_VERSION-aarch64-unknown-linux-musl/sccache /usr/local/bin
57-
chmod +x /usr/local/bin/sccache
58-
echo "$SCCACHE_SHA256 /usr/local/bin/sccache" | sha256sum --check
59-
env:
60-
SCCACHE_VERSION: 0.8.1
61-
SCCACHE_SHA256: "36b2fd1c6c3a104ec1d526edb0533a3827c266054bf4552fb97f524beff6a612"
62-
63-
- name: Set up Rust for x86_64
64-
if: ${{ matrix.arch == 'x64' }}
65-
uses: dtolnay/rust-toolchain@stable
66-
with:
67-
toolchain: 1.88.0
68-
target: x86_64-unknown-linux-gnu
69-
components: rustfmt, clippy, llvm-tools-preview
70-
71-
- name: Set up Rust for arm64
72-
if: ${{ matrix.arch == 'arm64' }}
56+
- name: Set up Rust
7357
uses: dtolnay/rust-toolchain@stable
7458
with:
75-
toolchain: 1.88.0
76-
target: aarch64-unknown-linux-gnu
59+
toolchain: 1.89.0
60+
target: ${{ matrix.arch }}-unknown-linux-gnu
7761
components: rustfmt, clippy, llvm-tools-preview
7862

7963
- name: Cache cargo registry
@@ -150,17 +134,17 @@ jobs:
150134
make check-lint
151135
152136
- name: Run tests without coverage
153-
if: ${{ env.PG_MAJOR != '17' || matrix.arch != 'x64' }}
137+
if: ${{ env.PG_MAJOR != '17' || matrix.arch != 'x86_64' }}
154138
run: |
155139
make check
156140
157141
- name: Run tests with coverage
158-
if: ${{ env.PG_MAJOR == '17' && matrix.arch == 'x64' }}
142+
if: ${{ env.PG_MAJOR == '17' && matrix.arch == 'x86_64' }}
159143
run: |
160144
make check-with-coverage
161145
162146
- name: Upload coverage report to Codecov
163-
if: ${{ env.PG_MAJOR == '17' && matrix.arch == 'x64' }}
147+
if: ${{ env.PG_MAJOR == '17' && matrix.arch == 'x86_64' }}
164148
uses: codecov/codecov-action@v4
165149
with:
166150
fail_ci_if_error: true

src/pgrx_tests/common.rs

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,16 @@ where
229229
}
230230

231231
pub(crate) fn assert_int_text_map(expected: Option<Map>, actual: Option<Map>) {
232-
if expected.is_none() {
233-
assert!(actual.is_none());
234-
} else {
232+
if let Some(expected) = expected {
235233
assert!(actual.is_some());
236234

237-
let expected = expected.unwrap().entries;
235+
let expected = expected.entries;
238236
let actual = actual.unwrap().entries;
239237

240238
for (expected, actual) in expected.iter().zip(actual.iter()) {
241-
if expected.is_none() {
242-
assert!(actual.is_none());
243-
} else {
239+
if let Some(expected) = expected {
244240
assert!(actual.is_some());
245241

246-
let expected = expected.unwrap();
247242
let actual = actual.unwrap();
248243

249244
let expected_key: Option<i32> = expected.get_by_name("key").unwrap();
@@ -255,21 +250,20 @@ pub(crate) fn assert_int_text_map(expected: Option<Map>, actual: Option<Map>) {
255250
let actual_val: Option<String> = actual.get_by_name("val").unwrap();
256251

257252
assert_eq!(expected_val, actual_val);
253+
} else {
254+
assert!(actual.is_none());
258255
}
259256
}
257+
} else {
258+
assert!(actual.is_none());
260259
}
261260
}
262261

263262
pub(crate) fn assert_float(expected_result: Vec<Option<f32>>, result: Vec<Option<f32>>) {
264263
for (expected, actual) in expected_result.into_iter().zip(result.into_iter()) {
265-
if expected.is_none() {
266-
assert!(actual.is_none());
267-
}
268-
269-
if expected.is_some() {
264+
if let Some(expected) = expected {
270265
assert!(actual.is_some());
271266

272-
let expected = expected.unwrap();
273267
let actual = actual.unwrap();
274268

275269
if expected.is_nan() {
@@ -280,20 +274,17 @@ pub(crate) fn assert_float(expected_result: Vec<Option<f32>>, result: Vec<Option
280274
} else {
281275
assert_eq!(expected, actual);
282276
}
277+
} else {
278+
assert!(actual.is_none());
283279
}
284280
}
285281
}
286282

287283
pub(crate) fn assert_double(expected_result: Vec<Option<f64>>, result: Vec<Option<f64>>) {
288284
for (expected, actual) in expected_result.into_iter().zip(result.into_iter()) {
289-
if expected.is_none() {
290-
assert!(actual.is_none());
291-
}
292-
293-
if expected.is_some() {
285+
if let Some(expected) = expected {
294286
assert!(actual.is_some());
295287

296-
let expected = expected.unwrap();
297288
let actual = actual.unwrap();
298289

299290
if expected.is_nan() {
@@ -304,40 +295,36 @@ pub(crate) fn assert_double(expected_result: Vec<Option<f64>>, result: Vec<Optio
304295
} else {
305296
assert_eq!(expected, actual);
306297
}
298+
} else {
299+
assert!(actual.is_none());
307300
}
308301
}
309302
}
310303

311304
pub(crate) fn assert_json(expected: Vec<Option<Json>>, result: Vec<Option<Json>>) {
312305
for (expected, actual) in expected.into_iter().zip(result.into_iter()) {
313-
if expected.is_none() {
314-
assert!(actual.is_none());
315-
}
316-
317-
if expected.is_some() {
306+
if let Some(expected) = expected {
318307
assert!(actual.is_some());
319308

320-
let expected = expected.unwrap();
321309
let actual = actual.unwrap();
322310

323311
assert_eq!(expected.0, actual.0);
312+
} else {
313+
assert!(actual.is_none());
324314
}
325315
}
326316
}
327317

328318
pub(crate) fn assert_jsonb(expected: Vec<Option<JsonB>>, result: Vec<Option<JsonB>>) {
329319
for (expected, actual) in expected.into_iter().zip(result.into_iter()) {
330-
if expected.is_none() {
331-
assert!(actual.is_none());
332-
}
333-
334-
if expected.is_some() {
320+
if let Some(expected) = expected {
335321
assert!(actual.is_some());
336322

337-
let expected = expected.unwrap();
338323
let actual = actual.unwrap();
339324

340325
assert_eq!(expected.0, actual.0);
326+
} else {
327+
assert!(actual.is_none());
341328
}
342329
}
343330
}

src/pgrx_tests/copy_options.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,8 @@ mod tests {
420420
fn test_parquet_version() {
421421
let fetch_parquet_version = || {
422422
Spi::connect(|client| {
423-
let parquet_file_metadata_command = format!(
424-
"select * from parquet.file_metadata('{}');",
425-
LOCAL_TEST_FILE_PATH
426-
);
423+
let parquet_file_metadata_command =
424+
format!("select * from parquet.file_metadata('{LOCAL_TEST_FILE_PATH}');",);
427425

428426
let mut results = Vec::new();
429427
let tup_table = client

0 commit comments

Comments
 (0)