Skip to content

Commit dbbedb8

Browse files
committed
ci: split build and test scripts
1 parent a3f805d commit dbbedb8

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

.github/workflows/build.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Build"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: cachix/install-nix-action@v30
15+
- run: nix profile install nixpkgs#devenv
16+
- name: Build
17+
run: devenv shell -- pnpm build
18+
# Check that build was committed
19+
- name: Verify latest build
20+
run: git diff --exit-code
21+
22+
test:
23+
needs: [build]
24+
uses: ./.github/workflows/test.yml
25+
secrets: inherit

.github/workflows/test.yml

+3-24
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
name: "cachix-action test"
2-
on:
3-
pull_request:
4-
push:
5-
branches:
6-
- master
1+
name: "Test"
2+
3+
on: workflow_call
74

85
env:
96
ACTIONS_STEP_DEBUG: true
107

118
jobs:
12-
build:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: cachix/install-nix-action@v30
17-
- run: nix profile install nixpkgs#devenv
18-
- name: Build
19-
run: devenv shell -- pnpm build
20-
# Check that build was committed
21-
- name: Verify latest build
22-
run: git diff --exit-code
23-
249
public-cache:
25-
needs: [build]
2610
strategy:
2711
matrix:
2812
os: [ubuntu-latest, macos-latest]
@@ -40,7 +24,6 @@ jobs:
4024
- run: nix-build test.nix
4125

4226
public-cache-no-signing-key:
43-
needs: [build]
4427
strategy:
4528
matrix:
4629
os: [ubuntu-latest, macos-latest]
@@ -57,7 +40,6 @@ jobs:
5740
- run: nix-build test.nix
5841

5942
private-cache:
60-
needs: [build]
6143
if: ${{ github.ref == 'refs/heads/master' }}
6244
strategy:
6345
matrix:
@@ -77,7 +59,6 @@ jobs:
7759
- run: nix-build test.nix
7860

7961
push-paths:
80-
needs: [build]
8162
strategy:
8263
matrix:
8364
os: [ubuntu-latest, macos-latest]
@@ -97,7 +78,6 @@ jobs:
9778
pathsToPush: "${{ steps.paths.outputs.OUT_PATHS }}"
9879

9980
installCommand:
100-
needs: [build]
10181
strategy:
10282
matrix:
10383
os: [ubuntu-latest, macos-latest]
@@ -114,7 +94,6 @@ jobs:
11494
- run: nix-build test.nix
11595

11696
nix-master:
117-
needs: [build]
11897
strategy:
11998
matrix:
12099
include:

0 commit comments

Comments
 (0)