1
0
Fork 0
mirror of https://github.com/cachix/cachix-action.git synced 2025-06-09 17:45:12 +09:00

ci: split build and test scripts

This commit is contained in:
Sander 2025-01-03 11:10:59 +04:00
parent a3f805d988
commit dbbedb8579
No known key found for this signature in database
GPG key ID: D1A763BC84F34603
2 changed files with 28 additions and 24 deletions

25
.github/workflows/build.yml vendored Normal file
View file

@ -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: ./.github/workflows/test.yml
secrets: inherit

View file

@ -1,28 +1,12 @@
name: "cachix-action test" name: "Test"
on:
pull_request: on: workflow_call
push:
branches:
- master
env: env:
ACTIONS_STEP_DEBUG: true ACTIONS_STEP_DEBUG: true
jobs: 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: public-cache:
needs: [build]
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
@ -40,7 +24,6 @@ jobs:
- run: nix-build test.nix - run: nix-build test.nix
public-cache-no-signing-key: public-cache-no-signing-key:
needs: [build]
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
@ -57,7 +40,6 @@ jobs:
- run: nix-build test.nix - run: nix-build test.nix
private-cache: private-cache:
needs: [build]
if: ${{ github.ref == 'refs/heads/master' }} if: ${{ github.ref == 'refs/heads/master' }}
strategy: strategy:
matrix: matrix:
@ -77,7 +59,6 @@ jobs:
- run: nix-build test.nix - run: nix-build test.nix
push-paths: push-paths:
needs: [build]
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
@ -97,7 +78,6 @@ jobs:
pathsToPush: "${{ steps.paths.outputs.OUT_PATHS }}" pathsToPush: "${{ steps.paths.outputs.OUT_PATHS }}"
installCommand: installCommand:
needs: [build]
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
@ -114,7 +94,6 @@ jobs:
- run: nix-build test.nix - run: nix-build test.nix
nix-master: nix-master:
needs: [build]
strategy: strategy:
matrix: matrix:
include: include: