Skip to content

Commit a3f805d

Browse files
committed
ci: build once with devenv
1 parent c48cfdb commit a3f805d

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/test.yml

+18-15
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,27 @@ env:
99
ACTIONS_STEP_DEBUG: true
1010

1111
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+
1224
public-cache:
25+
needs: [build]
1326
strategy:
1427
matrix:
1528
os: [ubuntu-latest, macos-latest]
1629
useDaemon: [true, false]
1730
runs-on: ${{ matrix.os }}
1831
steps:
1932
- uses: actions/checkout@v4
20-
- run: pnpm install --frozen-lockfile
21-
- run: pnpm build
22-
# check if typescript generation was committed
23-
- run: git diff --exit-code
2433
- uses: cachix/install-nix-action@v30
2534
- name: Test public cache
2635
uses: ./
@@ -31,15 +40,14 @@ jobs:
3140
- run: nix-build test.nix
3241

3342
public-cache-no-signing-key:
43+
needs: [build]
3444
strategy:
3545
matrix:
3646
os: [ubuntu-latest, macos-latest]
3747
useDaemon: [true, false]
3848
runs-on: ${{ matrix.os }}
3949
steps:
4050
- uses: actions/checkout@v4
41-
- run: pnpm install --frozen-lockfile
42-
- run: pnpm build
4351
- uses: cachix/install-nix-action@v30
4452
- name: Test public cache no signing key
4553
uses: ./
@@ -49,6 +57,7 @@ jobs:
4957
- run: nix-build test.nix
5058

5159
private-cache:
60+
needs: [build]
5261
if: ${{ github.ref == 'refs/heads/master' }}
5362
strategy:
5463
matrix:
@@ -57,8 +66,6 @@ jobs:
5766
runs-on: ${{ matrix.os }}
5867
steps:
5968
- uses: actions/checkout@v4
60-
- run: pnpm install --frozen-lockfile
61-
- run: pnpm build
6269
- uses: cachix/install-nix-action@v30
6370
- name: Test private cache
6471
uses: ./
@@ -70,14 +77,13 @@ jobs:
7077
- run: nix-build test.nix
7178

7279
push-paths:
80+
needs: [build]
7381
strategy:
7482
matrix:
7583
os: [ubuntu-latest, macos-latest]
7684
runs-on: ${{ matrix.os }}
7785
steps:
7886
- uses: actions/checkout@v4
79-
- run: pnpm install --frozen-lockfile
80-
- run: pnpm build
8187
- uses: cachix/install-nix-action@v30
8288
- id: paths
8389
run: |
@@ -91,14 +97,13 @@ jobs:
9197
pathsToPush: "${{ steps.paths.outputs.OUT_PATHS }}"
9298

9399
installCommand:
100+
needs: [build]
94101
strategy:
95102
matrix:
96103
os: [ubuntu-latest, macos-latest]
97104
runs-on: ${{ matrix.os }}
98105
steps:
99106
- uses: actions/checkout@v4
100-
- run: pnpm install --frozen-lockfile
101-
- run: pnpm build
102107
- uses: cachix/install-nix-action@v30
103108
- name: Test private cache
104109
uses: ./
@@ -109,6 +114,7 @@ jobs:
109114
- run: nix-build test.nix
110115

111116
nix-master:
117+
needs: [build]
112118
strategy:
113119
matrix:
114120
include:
@@ -133,9 +139,6 @@ jobs:
133139
install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install
134140
install_options: "--tarball-url-prefix http://localhost:8080"
135141

136-
- run: pnpm install --frozen-lockfile
137-
- run: pnpm build
138-
139142
- name: Test public cache
140143
uses: ./
141144
with:

0 commit comments

Comments
 (0)