Skip to content

Commit

Permalink
Serialize workflows using Nix caching
Browse files Browse the repository at this point in the history
Alleviates the pressure on the GitHub action cache by only allowing a
single nix-caching job at a time.

Fixes TraceMachina#464
Fixes TraceMachina#611
  • Loading branch information
aaronmondal committed Jan 18, 2024
1 parent 56a0972 commit a3292aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions: read-all

jobs:
publish-image:
concurrency:
group: uses-nix-caching-{{ github.ref }}
runs-on: large-ubuntu-22.04
permissions:
packages: write
Expand All @@ -28,9 +30,9 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# - name: Cache Nix derivations TODO(aaronmondal): revisit this bit when there are less flakes or it is more understood
# uses: >- # Custom commit, last pinned at 2023-11-17.
# DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
- name: Test image
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
//local-remote-execution/examples:hello_lre"
remote:
concurrency:
group: uses-nix-caching-{{ github.ref }}
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
bash -c "bazel test ... --verbose_failures"
nix-cargo:
concurrency:
group: uses-nix-caching-{{ github.ref }}
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit a3292aa

Please sign in to comment.