Skip to content

Add integration test workflow #7

Add integration test workflow

Add integration test workflow #7

Workflow file for this run

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-magic-nix-cache-action:
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
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Extract
id: extract
run: |
OUTPUT=$(cat magic-nix-cache.closure.xz | xz -d | nix-store --import)
MNC_BIN_PATH=$(echo "${OUTPUT}" | tail -n 1)
MAGIC_NIX_CACHE="${MNC_BIN_PATH}/bin/magic-nix-cache"
echo "mnc-path=${MAGIC_NIX_CACHE}" >> "$GITHUB_OUTPUT"
- uses: DeterminateSystems/magic-nix-cache-action@main
with:
source-binary: "${{ steps.extract.outputs.mnc-path }}"