From 6eaa23c96328d580ad0415ffe39f3cdc1cc27c76 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Sat, 18 May 2024 16:41:44 -0300 Subject: [PATCH] Rework integration test --- .github/workflows/build.yaml | 3 +- .../{test.yaml => check-and-test.yaml} | 38 ++++++++++++++++--- .github/workflows/checks.yaml | 30 --------------- 3 files changed, 35 insertions(+), 36 deletions(-) rename .github/workflows/{test.yaml => check-and-test.yaml} (61%) delete mode 100644 .github/workflows/checks.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 24bcf75..98ba772 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -39,7 +39,8 @@ jobs: - name: Build package and create closure run: | - nix build .# -L --fallback && nix-store --export $(nix-store -qR ./result) | xz -9 > "${{ env.CLOSURE_FILE }}" + nix build .# -L --fallback && \ + nix-store --export $(nix-store -qR ./result) | xz -9 > "${{ env.CLOSURE_FILE }}" - name: Upload a Build Artifact uses: actions/upload-artifact@v3.1.2 diff --git a/.github/workflows/test.yaml b/.github/workflows/check-and-test.yaml similarity index 61% rename from .github/workflows/test.yaml rename to .github/workflows/check-and-test.yaml index aa8887f..133ac0c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/check-and-test.yaml @@ -1,14 +1,42 @@ -name: Integration tests +name: Run checks and integration test on: - workflow_run: - workflows: ["Build artifacts"] - types: - - completed + pull_request: + push: + branches: [main] jobs: + 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 + with: + fail-mode: true + + - name: Check Rust formatting + run: nix develop --command cargo fmt --check + + - name: Clippy + run: nix develop --command cargo clippy + + build: + needs: checks + uses: ./.github/workflows/build.yaml + secrets: inherit + test-magic-nix-cache-action: runs-on: ${{ matrix.systems.runner }} + needs: build env: CLOSURE_FILE: magic-nix-cache-${{ matrix.systems.system }} strategy: diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml deleted file mode 100644 index 89acd01..0000000 --- a/.github/workflows/checks.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Rust checks - -on: - pull_request: - push: - branches: [main] - -jobs: - 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 - with: - fail-mode: true - - - name: Check Rust formatting - run: nix develop --command cargo fmt --check - - - name: Clippy - run: nix develop --command cargo clippy