1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 19:57:59 +02:00

Collapse build / test into one .yml to make skips easier

This commit is contained in:
Graham Christensen 2025-03-28 12:25:25 -04:00
parent 42cb189703
commit c134cf52db
4 changed files with 22 additions and 61 deletions

View file

@ -11,6 +11,10 @@ on:
required: false required: false
default: true default: true
type: boolean type: boolean
run_tests:
required: false
default: true
type: boolean
jobs: jobs:
build: build:
@ -31,3 +35,16 @@ jobs:
with: with:
name: ${{ inputs.system }} name: ${{ inputs.system }}
path: ./tarball/*.xz 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 }}

View file

@ -51,39 +51,6 @@ jobs:
os: namespace-profile-mac-m2-12c28g os: namespace-profile-mac-m2-12c28g
system: aarch64-darwin 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: vm_tests_smoke:
if: github.event_name != 'merge_group' if: github.event_name != 'merge_group'
needs: build_x86_64-linux needs: build_x86_64-linux
@ -165,7 +132,7 @@ jobs:
run: nix build .#hydraJobs.manual run: nix build .#hydraJobs.manual
- uses: nwtgck/actions-netlify@v3.0 - uses: nwtgck/actions-netlify@v3.0
with: with:
publish-dir: './result/share/doc/nix/manual' publish-dir: "./result/share/doc/nix/manual"
production-branch: detsys-main production-branch: detsys-main
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions" deploy-message: "Deploy from GitHub Actions"

View file

@ -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 }}

View file

@ -30,24 +30,28 @@ jobs:
with: with:
os: blacksmith-32vcpu-ubuntu-2204 os: blacksmith-32vcpu-ubuntu-2204
system: x86_64-linux system: x86_64-linux
run_tests: false
build-aarch64-linux: build-aarch64-linux:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
os: blacksmith-32vcpu-ubuntu-2204-arm os: blacksmith-32vcpu-ubuntu-2204-arm
system: aarch64-linux system: aarch64-linux
run_tests: false
build-x86_64-darwin: build-x86_64-darwin:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
os: macos-13 os: macos-13
system: x86_64-darwin system: x86_64-darwin
run_tests: false
build-aarch64-darwin: build-aarch64-darwin:
uses: ./.github/workflows/build.yml uses: ./.github/workflows/build.yml
with: with:
os: macos-latest os: macos-latest
system: aarch64-darwin system: aarch64-darwin
run_tests: false
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest