From 6de799dfe5d3d62125c601ce795010cad30b4064 Mon Sep 17 00:00:00 2001 From: Aaron Siddhartha Mondal Date: Tue, 30 Jan 2024 23:47:06 +0100 Subject: [PATCH] Reenable caching for nix workflows (#631) The previous crashes have been fixed in Nix 2.19.3. Thix commit also includes missing `github-token` fields which increase the API rate limit. Fixes: https://github.com/TraceMachina/nativelink/issues/464 --- .github/workflows/image.yaml | 13 ++++++------- .github/workflows/lre.yaml | 24 ++++++++++++++---------- .github/workflows/nix.yaml | 14 ++++++++++---- .github/workflows/pre-commit.yaml | 10 ++++++++-- .github/workflows/tagged_image.yaml | 9 +++++++-- 5 files changed, 45 insertions(+), 25 deletions(-) diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index cf173aa3d..bf8ba27b5 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -23,16 +23,15 @@ jobs: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Install Nix - uses: >- # v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e with: github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 - # TODO(aaronmondal): Caching is flaky for this workflow. - # See: https://github.com/DeterminateSystems/magic-nix-cache/issues/32 - # - name: Cache Nix derivations - # 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: | diff --git a/.github/workflows/lre.yaml b/.github/workflows/lre.yaml index 83ed5aa1f..3401edd14 100644 --- a/.github/workflows/lre.yaml +++ b/.github/workflows/lre.yaml @@ -24,8 +24,11 @@ jobs: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Install Nix - uses: >- #v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 - name: Cache Nix derivations uses: >- # Custom commit, last pinned at 2023-11-17. @@ -52,14 +55,15 @@ jobs: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Install Nix - uses: >- #v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 - - # TODO(aaronmondal): Caching is flaky for this workflow. - # See: https://github.com/DeterminateSystems/magic-nix-cache/issues/32 - # - name: Cache Nix derivations - # uses: >- # Custom commit, last pinned at 2023-11-17. - # DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 + + - name: Cache Nix derivations + uses: >- # Custom commit, last pinned at 2023-11-17. + DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1 - name: Start Kubernetes cluster (Infra) run: > diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml index a385affa3..18438011a 100644 --- a/.github/workflows/nix.yaml +++ b/.github/workflows/nix.yaml @@ -24,8 +24,11 @@ jobs: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Install Nix - uses: >- #v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 - name: Cache Nix derivations uses: >- # Custom commit, last pinned at 2023-11-17. @@ -65,8 +68,11 @@ jobs: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Install Nix - uses: >- #v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 - name: Cache Nix derivations uses: >- # Custom commit, last pinned at 2023-11-17. diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index f203ebaf9..a86661ad2 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -17,11 +17,17 @@ jobs: - name: Checkout uses: >- # v3.5.3 actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - name: Install Nix - uses: >- #v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 + - name: Cache Nix derivations uses: >- # Custom commit, last pinned at 2023-11-17. DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1 + - name: Run pre-commit hooks run: nix flake check diff --git a/.github/workflows/tagged_image.yaml b/.github/workflows/tagged_image.yaml index 67dc3f65c..fdb83a7ba 100644 --- a/.github/workflows/tagged_image.yaml +++ b/.github/workflows/tagged_image.yaml @@ -20,10 +20,15 @@ jobs: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Install Nix - uses: >- # v7 - DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 + uses: >- # v9 + DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e with: github-token: ${{ secrets.GITHUB_TOKEN }} + nix-installer-tag: v0.16.1 + + - name: Cache Nix derivations + uses: >- # Custom commit, last pinned at 2023-11-17. + DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1 - name: Test image run: |