Skip to content

Commit ae363f2

Browse files
committed
Cache .build after building tests, before running them
1 parent cde8292 commit ae363f2

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ jobs:
5151
key: "spi-debug-build-${{ runner.os }}-${{ github.event.after }}"
5252
restore-keys: "spi-debug-build-${{ runner.os }}-"
5353

54-
- name: Run tests
55-
run: cp .env.testing.template .env.testing && make test
56-
env:
57-
COLLECTION_SIGNING_PRIVATE_KEY: ${{ secrets.COLLECTION_SIGNING_PRIVATE_KEY }}
54+
- name: Build tests
55+
run: cp .env.testing.template .env.testing && make build-tests
5856

5957
- name: Cache .build
6058
if: steps.restore-cache.outputs.cache-hit != 'true'
6159
uses: actions/cache/save@v4
6260
with:
6361
path: .build
6462
key: "spi-debug-build-${{ runner.os }}-${{ github.event.after }}"
63+
64+
- name: Run tests
65+
run: cp .env.testing.template .env.testing && make run-tests
66+
env:
67+
COLLECTION_SIGNING_PRIVATE_KEY: ${{ secrets.COLLECTION_SIGNING_PRIVATE_KEY }}
6568

6669
services:
6770
spi_test_0:

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,25 @@ endif
3030
build:
3131
swift build --disable-automatic-resolution --enable-experimental-prebuilts
3232

33-
3433
run:
3534
swift run
3635

37-
test: xcbeautify
36+
build-tests: xcbeautify
37+
set -o pipefail \
38+
&& swift build --build-tests \
39+
--disable-automatic-resolution \
40+
--enable-experimental-prebuilts \
41+
2>&1 | xcbeautify --renderer github-actions
42+
43+
run-tests: xcbeautify
3844
set -o pipefail \
39-
&& swift test --disable-automatic-resolution \
45+
&& swift test --skip-build \
46+
--disable-automatic-resolution \
4047
--enable-experimental-prebuilts \
4148
2>&1 | xcbeautify --renderer github-actions
4249

50+
test: build-tests run-tests
51+
4352
test-query-performance: xcbeautify
4453
set -o pipefail \
4554
&& env RUN_QUERY_PERFORMANCE_TESTS=true \

0 commit comments

Comments
 (0)