magic-nix-cache/.github/workflows/test.yaml
2024-05-17 17:14:50 -03:00

48 lines
1.2 KiB
YAML

name: Integration tests
on:
pull_request:
push:
branches: [main]
jobs:
build-linux:
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build package
run: "nix build .# -L --fallback && nix-store --export $(nix-store -qR ./result) | xz -9 > magic-nix-cache.closure.xz"
- name: Cache magix-nix-cache closure
uses: actions/cache/save@v4
with:
path: magic-nix-cache.closure.xz
key: magic-nix-cache-${{ github.sha }}
test-linux:
needs: build-linux
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
steps:
- name: Restore magix-nix-cache closure
uses: actions/cache/restore@v4
with:
path: magic-nix-cache.closure.xz
key: magic-nix-cache-${{ github.sha }}
fail-on-cache-miss: true
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
source-binary: "magic-nix-cache.closure.xz"