From c134cf52dbae31e28b76f2472055d984280b63a0 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 28 Mar 2025 12:25:25 -0400 Subject: [PATCH] Collapse build / test into one .yml to make skips easier --- .github/workflows/build.yml | 17 ++++++++++++++ .github/workflows/ci.yml | 35 +--------------------------- .github/workflows/test.yml | 27 --------------------- .github/workflows/upload-release.yml | 4 ++++ 4 files changed, 22 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84dbdfd79..607a31a6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,10 @@ on: required: false default: true type: boolean + run_tests: + required: false + default: true + type: boolean jobs: build: @@ -31,3 +35,16 @@ jobs: with: name: ${{ inputs.system }} path: ./tarball/*.xz + test: + if: ${{ inputs.if && inputs.run_tests}} + strategy: + fail-fast: false + runs-on: ${{ inputs.os }} + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + with: + determinate: true + - uses: DeterminateSystems/flakehub-cache-action@main + - run: nix flake check -L --system ${{ inputs.system }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bff8dcc4e..6c400f29b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,39 +51,6 @@ jobs: os: namespace-profile-mac-m2-12c28g system: aarch64-darwin - test_x86_64-linux: - uses: ./.github/workflows/test.yml - needs: build_x86_64-linux - with: - os: blacksmith-32vcpu-ubuntu-2204 - system: x86_64-linux - - test_aarch64-linux: - if: success() || failure() - uses: ./.github/workflows/test.yml - needs: build_aarch64-linux - with: - if: ${{ github.event_name == 'merge_group' }} - os: blacksmith-32vcpu-ubuntu-2204-arm - system: aarch64-linux - - test_x86_64-darwin: - if: success() || failure() - uses: ./.github/workflows/test.yml - needs: build_x86_64-darwin - with: - if: ${{ github.event_name == 'merge_group' }} - os: namespace-profile-mac-m2-12c28g - system: x86_64-darwin - - test_aarch64-darwin: - uses: ./.github/workflows/test.yml - needs: build_aarch64-darwin - with: - if: ${{ github.event_name == 'merge_group' }} - os: namespace-profile-mac-m2-12c28g - system: aarch64-darwin - vm_tests_smoke: if: github.event_name != 'merge_group' needs: build_x86_64-linux @@ -165,7 +132,7 @@ jobs: run: nix build .#hydraJobs.manual - uses: nwtgck/actions-netlify@v3.0 with: - publish-dir: './result/share/doc/nix/manual' + publish-dir: "./result/share/doc/nix/manual" production-branch: detsys-main github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: "Deploy from GitHub Actions" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 49af88020..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - workflow_call: - inputs: - os: - required: true - type: string - system: - required: true - type: string - if: - required: false - default: true - type: boolean -jobs: - tests: - if: ${{ inputs.if }} - strategy: - fail-fast: false - runs-on: ${{ inputs.os }} - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - with: - flakehub: true - - uses: DeterminateSystems/flakehub-cache-action@main - - run: nix flake check -L --system ${{ inputs.system }} diff --git a/.github/workflows/upload-release.yml b/.github/workflows/upload-release.yml index f762446bd..083f39dfd 100644 --- a/.github/workflows/upload-release.yml +++ b/.github/workflows/upload-release.yml @@ -30,24 +30,28 @@ jobs: with: os: blacksmith-32vcpu-ubuntu-2204 system: x86_64-linux + run_tests: false build-aarch64-linux: uses: ./.github/workflows/build.yml with: os: blacksmith-32vcpu-ubuntu-2204-arm system: aarch64-linux + run_tests: false build-x86_64-darwin: uses: ./.github/workflows/build.yml with: os: macos-13 system: x86_64-darwin + run_tests: false build-aarch64-darwin: uses: ./.github/workflows/build.yml with: os: macos-latest system: aarch64-darwin + run_tests: false release: runs-on: ubuntu-latest