Skip to content

Commit 9d33e3b

Browse files
committed
Enable caching on the prerequiste CI jobs to improve time-to-feedback.
1 parent 6696698 commit 9d33e3b

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
toolchain: stable
1818
profile: minimal
1919
components: rustfmt, clippy
20+
- uses: Swatinem/rust-cache@v1
21+
continue-on-error: true
2022
- env:
2123
CLIPPYFLAGS: --deny warnings --allow clippy::needless-lifetimes
2224
run: |
@@ -87,30 +89,32 @@ jobs:
8789
profile: minimal
8890
toolchain: 1.48.0
8991
default: true
92+
- uses: Swatinem/rust-cache@v1
93+
with:
94+
working-directory: examples/simple-extension
95+
continue-on-error: true
9096
- name: Install maturin, poetry, and toml
9197
run: pip install maturin poetry toml
92-
- name: Create an isolated example directory
93-
run: cp -r examples/simple-extension/ ../simple-extension-msrv
94-
- name: Edit Cargo.toml and change the path of rust-numpy
98+
- name: Edit Cargo.toml and detach from workspace
9599
run: |
96100
import toml
97101
cargo_toml = toml.load("Cargo.toml")
98-
cargo_toml["dependencies"]["numpy"]["path"] = "../rust-numpy"
99102
cargo_toml["dependencies"]["ndarray"] = "0.13.1"
100103
cargo_toml["dependencies"]["num-complex"] = "0.2.4"
104+
cargo_toml["workspace"] = {}
101105
with open("Cargo.toml", "w") as f:
102106
toml.dump(cargo_toml, f)
103-
working-directory: ../simple-extension-msrv
107+
working-directory: examples/simple-extension
104108
shell: python
105109
- name: Use ndarray 0.13.1
106110
run: |
107111
cargo generate-lockfile
108112
cargo update -p $(cargo pkgid -p ndarray 2>&1 >/dev/null | grep 0.15 | sed -e 's/^[ \t]*//') --precise 0.13.1
109-
working-directory: ../simple-extension-msrv
113+
working-directory: examples/simple-extension
110114
- name: Test Example
111115
run: |
112116
poetry install && poetry run maturin develop && poetry run pytest
113-
working-directory: ../simple-extension-msrv
117+
working-directory: examples/simple-extension
114118
shell: bash
115119

116120
linalg-example:
@@ -128,6 +132,8 @@ jobs:
128132
uses: actions-rs/toolchain@v1
129133
with:
130134
toolchain: stable
135+
- uses: Swatinem/rust-cache@v1
136+
continue-on-error: true
131137
- name: Install maturin and poetry
132138
run: pip install maturin poetry
133139
- name: Test Examples

0 commit comments

Comments
 (0)