From 85ed8b7f7839311125b2ea4c52bcb077fa11635b Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 23 May 2024 13:13:04 -0500 Subject: [PATCH] update on-demand definition --- .github/workflows/build.yml | 5 ++++- .github/workflows/on-demand.yml | 19 +++++++++++++------ todo.md | 2 ++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4860249..1f4b350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,10 @@ jobs: strategy: max-parallel: 1 matrix: - host: ["othalan", "mannaz", "algiz"] + host: + - othalan + # - mannaz + # - algiz steps: # free up some space - run: sudo rm -rf /opt& diff --git a/.github/workflows/on-demand.yml b/.github/workflows/on-demand.yml index 650873f..1735478 100644 --- a/.github/workflows/on-demand.yml +++ b/.github/workflows/on-demand.yml @@ -10,11 +10,19 @@ on: type: string lockFile: description: 'flake.lock file' - required: true type: string + workflow_call: + inputs: + host: + description: 'host name to build' + required: true + default: 'othalan' + type: string + + concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }} cancel-in-progress: true jobs: @@ -23,10 +31,9 @@ jobs: steps: # free up some space - run: sudo rm -rf /opt& - - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + + - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@v2 - uses: cachix/cachix-action@v14 @@ -35,11 +42,11 @@ jobs: authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: write lock file + if: "${{ inputs.lockFile != '' }}" run: | echo '${{ inputs.lockFile }}' > flake.lock git diff - - name: Build run: | nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake . diff --git a/todo.md b/todo.md index 9fa1cc2..ad4544f 100644 --- a/todo.md +++ b/todo.md @@ -12,4 +12,6 @@ - [ ] find out why pixi on GHA is different from local (possibly from the fetch git step?) +- [ ] rework CI so it's not building all systems on every pull +