Skip to content

Commit

Permalink
ci: split build and test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Jan 3, 2025
1 parent a3f805d commit 043175c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Build"

on:
pull_request:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- run: nix profile install nixpkgs#devenv
- name: Build
run: devenv shell -- pnpm build
# Check that build was committed
- name: Verify latest build
run: git diff --exit-code

test:
needs: [build]
uses: ./test.yml
secrets: inherit
27 changes: 3 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
name: "cachix-action test"
on:
pull_request:
push:
branches:
- master
name: "Test"

on: workflow_call

env:
ACTIONS_STEP_DEBUG: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- run: nix profile install nixpkgs#devenv
- name: Build
run: devenv shell -- pnpm build
# Check that build was committed
- name: Verify latest build
run: git diff --exit-code

public-cache:
needs: [build]
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -40,7 +24,6 @@ jobs:
- run: nix-build test.nix

public-cache-no-signing-key:
needs: [build]
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -57,7 +40,6 @@ jobs:
- run: nix-build test.nix

private-cache:
needs: [build]
if: ${{ github.ref == 'refs/heads/master' }}
strategy:
matrix:
Expand All @@ -77,7 +59,6 @@ jobs:
- run: nix-build test.nix

push-paths:
needs: [build]
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -97,7 +78,6 @@ jobs:
pathsToPush: "${{ steps.paths.outputs.OUT_PATHS }}"

installCommand:
needs: [build]
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -114,7 +94,6 @@ jobs:
- run: nix-build test.nix

nix-master:
needs: [build]
strategy:
matrix:
include:
Expand Down

0 comments on commit 043175c

Please sign in to comment.