Add integration test workflow

This commit is contained in:
Luc Perkins 2024-05-20 13:28:49 -03:00
parent 42a91dd0aa
commit ace4d5c605
No known key found for this signature in database
GPG Key ID: 16DB1108FB591835
2 changed files with 47 additions and 8 deletions

View File

@ -3,9 +3,6 @@ name: Build flake-checker artifacts
on:
workflow_call:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
build-artifacts:
@ -18,16 +15,16 @@ jobs:
systems:
- nix-system: aarch64-darwin
runner: macos-latest-xlarge
artifact: flake-checker-ARM64-macOS
system: ARM64-macOS
- nix-system: x86_64-darwin
runner: macos-12
artifact: flake-checker-X64-macOS
system: X64-macOS
- nix-system: aarch64-linux
runner: namespace-profile-default-arm64
artifact: flake-checker-X64-Linux
system: X64-Linux
- nix-system: x86_64-linux
runner: ubuntu-22.04
artifact: flake-checker-ARM64-Linux
system: ARM64-Linux
steps:
- name: git checkout
uses: actions/checkout@v4
@ -40,6 +37,10 @@ jobs:
with:
use-flakehub: true
- name: Build and cache dev shell for ${{ matrix.systems.nix-system }}
run: |
nix build -L ".#devShells.${{ matrix.systems.nix-system }}.default"
- name: Build package for ${{ matrix.systems.nix-system }}
run: |
nix build -L ".#packages.${{ matrix.systems.nix-system }}.default"
@ -48,6 +49,6 @@ jobs:
uses: actions/upload-artifact@v3.1.2
with:
# Artifact name
name: ${{ matrix.systems.artifact }}
name: flake-checker-${{ matrix.systems.system }}
path: result/bin/flake-checker
retention-days: 1

View File

@ -25,6 +25,12 @@ jobs:
- name: Clippy
run: nix develop -c cargo clippy
build-artifacts:
name: Build artifacts
needs: checks
uses: ./.github/workflows/build.yaml
secrets: inherit
rust-tests:
name: Test Rust
runs-on: ubuntu-22.04
@ -72,3 +78,35 @@ jobs:
- name: Check flake.lock
run: |
nix develop -c cargo run -- --fail-mode ./tests/flake.dirty.0.lock
action-integration-test:
name: Integration test for flake-checker-action
needs: build-artifacts
runs-on: ${{ matrix.systems.runner }}
permissions:
contents: read
id-token: write
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
steps:
- uses: actions/checkout@v4
- name: Download flake-checker for ${{ matrix.systems.system }}
uses: actions/download-artifact@v3
with:
name: flake-checker-${{ matrix.systems.system }}
path: flake-checker
- name: Test flake-checker-action@main on ${{ matrix.systems.runner }}
uses: DeterminateSystems/flake-checker-action@main
with:
source-binary: flake-checker