96 lines
2.7 KiB
YAML
96 lines
2.7 KiB
YAML
name: Run checks and integration test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
checks:
|
|
name: Nix and Rust checks
|
|
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: Check health of flake.lock
|
|
uses: DeterminateSystems/flake-checker-action@main
|
|
# TODO: re-enable fail mode when we find a way to bump Nixpkgs to 24.05
|
|
# without breaking the static Rust build
|
|
#with:
|
|
# fail-mode: true
|
|
|
|
- name: Check Rust formatting
|
|
run: nix develop --command cargo fmt --check
|
|
|
|
- name: Clippy
|
|
run: nix develop --command cargo clippy
|
|
|
|
build:
|
|
name: Build artifacts
|
|
needs: checks
|
|
uses: ./.github/workflows/build.yaml
|
|
secrets: inherit
|
|
|
|
action-integration-test:
|
|
name: Integration test for magic-nix-cache-action
|
|
runs-on: ${{ matrix.systems.runner }}
|
|
needs: build
|
|
env:
|
|
ARTIFACT_KEY: magic-nix-cache-${{ matrix.systems.system }}
|
|
ARCHIVE_NAME: magic-nix-cache.closure.xz
|
|
strategy:
|
|
matrix:
|
|
systems:
|
|
- system: X64-Linux
|
|
runner: ubuntu-22.04
|
|
- system: ARM64-Linux
|
|
runner: namespace-profile-default-arm64
|
|
- system: X64-macOS
|
|
runner: macos-12
|
|
- system: ARM64-macOS
|
|
runner: macos-latest-xlarge
|
|
extra_nix_installer_args:
|
|
- "--determinate"
|
|
- ""
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Download closure for ${{ matrix.systems.system }}
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: ${{ env.ARTIFACT_KEY }}
|
|
path: ${{ env.ARTIFACT_KEY }}
|
|
|
|
- name: Install Nix on ${{ matrix.systems.system }}
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
with:
|
|
source-pr: 1163
|
|
extra-args: ${{ matrix.extra_nix_installer_args }}
|
|
- run: determinate-nixd login github-action
|
|
|
|
- name: Test magic-nix-cache-action@main on ${{ matrix.systems.runner }}
|
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
|
with:
|
|
source-binary: "${{ env.ARTIFACT_KEY }}/${{ env.ARCHIVE_NAME }}"
|
|
_internal-strict-mode: true
|
|
|
|
- name: Run nix to test magic-nix-cache-action
|
|
run: |
|
|
nix develop --command echo "just testing"
|
|
- name: Exhaust our GitHub Actions Cache tokens
|
|
# Generally skip this step since it is so intensive
|
|
if: ${{ false }}
|
|
run: |
|
|
date >> README.md
|
|
nix build .#veryLongChain -v
|