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