Repository navigation
127 lines (121 loc) · 4.06 KB
/
Copy pathrust-cache.yml
File metadata and controls
127 lines (121 loc) · 4.06 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
name: Rust Build Cache
# Saves the native dependency builds that Verify restores. Verify never saves its own: a cache saved
# by a pull request or merge queue run is visible only to that ref, while one saved on main is
# visible to every pull request. Each job runs the same cargo builds as the Verify jobs sharing its
# key, so the cached artifacts match theirs, and builds only when main has no cache for the current
# lockfile and toolchain. Release distributions never use these caches; Dist Dependency Cache saves
# theirs.
on:
push:
branches: [main]
# A new stable toolchain changes the key without a push to main.
schedule:
- cron: "30 4 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: rust-cache-${{ github.ref }}
cancel-in-progress: false
jobs:
linux:
name: Linux extension
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-uv
with:
version: "0.12.3"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Look up the cache
id: lookup
uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
lookup-only: true
save-if: false
- name: Restore the closest cache
if: steps.lookup.outputs.cache-hit != 'true'
uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
- name: Install Python
if: steps.lookup.outputs.cache-hit != 'true'
run: uv python install 3.12
- name: Build the extension as Verify does
if: steps.lookup.outputs.cache-hit != 'true'
run: uv sync --locked --all-groups --all-extras
checks:
name: Linux extension and native checks
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-uv
with:
version: "0.12.3"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Look up the cache
id: lookup
uses: Swatinem/rust-cache@v2
with:
shared-key: verify-checks
lookup-only: true
save-if: false
- name: Restore the closest cache
if: steps.lookup.outputs.cache-hit != 'true'
uses: Swatinem/rust-cache@v2
with:
shared-key: verify-checks
- name: Install Python
if: steps.lookup.outputs.cache-hit != 'true'
run: uv python install 3.12
- name: Build the extension as Verify does
if: steps.lookup.outputs.cache-hit != 'true'
run: uv sync --locked --all-groups --all-extras
- name: Build the native checks as make rust-check does
if: steps.lookup.outputs.cache-hit != 'true'
run: |
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-features --no-run
windows:
name: Windows extension
runs-on: windows-2025
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-uv
with:
version: "0.12.3"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Look up the cache
id: lookup
uses: Swatinem/rust-cache@v2
with:
shared-key: verify-windows
lookup-only: true
save-if: false
- name: Restore the closest cache
if: steps.lookup.outputs.cache-hit != 'true'
uses: Swatinem/rust-cache@v2
with:
shared-key: verify-windows
- name: Build the native discovery tests as Verify does
if: steps.lookup.outputs.cache-hit != 'true'
run: cargo test --locked -p sqlbuild-discovery --no-run
- name: Install Python
if: steps.lookup.outputs.cache-hit != 'true'
run: uv python install 3.12
- name: Build the extension as Verify does
if: steps.lookup.outputs.cache-hit != 'true'
run: uv sync --locked --no-dev --python 3.12