Skip to content

Commit 47fa6f0

Browse files
committed
Cache build output again for tests
For releases this doesn't make much sense as caches are scoped per branch/tag and thus each release would get a new cache to begin with. However, for `main` and such it should speed things up a tad.
1 parent eac339d commit 47fa6f0

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

.github/workflows/push.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ jobs:
8989
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
9090
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
9191
with:
92-
path: '${{ env.CARGO_HOME }}'
93-
key: std-docs-main-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
92+
path: |
93+
'${{ env.CARGO_HOME }}'
94+
target
95+
key: std-docs-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
9496
- run: git config --global --add safe.directory $PWD
9597
- name: Deploy the documentation
9698
env:

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
6060
with:
6161
path: '~/.local/share/inko/packages'
62-
key: docs-release-${{ hashFiles('docs/inko.pkg') }}
62+
key: docs-${{ hashFiles('docs/inko.pkg') }}
6363
- run: git config --global --add safe.directory $PWD
6464
- name: Deploy the documentation
6565
run: make docs/publish DOCS_REF=${{ github.ref_name }}
@@ -86,7 +86,7 @@ jobs:
8686
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
8787
with:
8888
path: '${{ env.CARGO_HOME }}'
89-
key: std-docs-release-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
89+
key: std-docs-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
9090
- run: git config --global --add safe.directory $PWD
9191
- name: Deploy the documentation
9292
run: make std-docs/publish DOCS_REF=${{ github.ref_name }}

.github/workflows/tests.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ jobs:
5757
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5858
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
5959
with:
60-
path: '${{ env.CARGO_HOME }}'
60+
path: |
61+
'${{ env.CARGO_HOME }}'
62+
target
6163
key: inko-fmt-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
6264
- name: Build the compiler
6365
run: cargo build
@@ -87,7 +89,9 @@ jobs:
8789
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
8890
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
8991
with:
90-
path: '${{ env.CARGO_HOME }}'
92+
path: |
93+
'${{ env.CARGO_HOME }}'
94+
target
9195
key: ${{ matrix.target.name }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
9296
- name: Run compiler tests
9397
run: cargo +${{ matrix.target.version }} test
@@ -113,7 +117,9 @@ jobs:
113117
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
114118
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
115119
with:
116-
path: '${{ env.CARGO_HOME }}'
120+
path: |
121+
'${{ env.CARGO_HOME }}'
122+
target
117123
key: ${{ matrix.target.name }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
118124
- name: Run tests
119125
run: 'cd std && cargo run -- test --verify ${{ matrix.flags }}'
@@ -139,6 +145,7 @@ jobs:
139145
path: |
140146
${{ env.CARGO_HOME }}
141147
${{ env.RUSTUP_HOME }}
148+
target
142149
key: ${{ matrix.target.name }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
143150
- name: Install dependencies
144151
run: ./ci/mac.sh
@@ -169,6 +176,7 @@ jobs:
169176
path: |
170177
${{ env.CARGO_HOME }}
171178
${{ env.RUSTUP_HOME }}
179+
target
172180
key: ${{ matrix.target.name }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
173181
- name: Install dependencies
174182
run: ./ci/mac.sh
@@ -188,6 +196,7 @@ jobs:
188196
path: |
189197
${{ env.CARGO_HOME }}
190198
${{ env.RUSTUP_HOME }}
199+
target
191200
key: amd64-freebsd-native-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
192201
- name: Run tests
193202
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455
@@ -214,6 +223,7 @@ jobs:
214223
path: |
215224
${{ env.CARGO_HOME }}
216225
${{ env.RUSTUP_HOME }}
226+
target
217227
key: amd64-freebsd-native-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
218228
- name: Run tests
219229
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455

0 commit comments

Comments
 (0)