From a934dd4f96d4c6e3c31726df283f7b85c5210e8b Mon Sep 17 00:00:00 2001 From: HuangYi Date: Thu, 10 Nov 2022 12:57:01 +0800 Subject: [PATCH] Problem: nix exceeds github rate limit occationally in CI Solution: - configure access-token - update the action plugins --- .github/workflows/build.yml | 14 +++++++++++--- .github/workflows/lint.yml | 14 +++++++++++--- .github/workflows/release.yml | 14 ++++++++++---- .github/workflows/test.yml | 16 ++++++++++++---- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be197ef420..f22b08cc1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,11 @@ jobs: files: | go.mod go.sum - - uses: cachix/install-nix-action@v15 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} if: steps.changed-files.outputs.any_changed == 'true' - name: gomod2nix run: nix run -f ./nix gomod2nix @@ -105,9 +109,13 @@ jobs: with: files: | contracts - - uses: cachix/install-nix-action@v15 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} if: steps.changed-files.outputs.any_changed == 'true' - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 if: steps.changed-files.outputs.any_changed == 'true' with: name: cronos diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7070c2197a..10d73f5b35 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -52,9 +52,13 @@ jobs: **/poetry.lock **/pyproject.toml **/*.py - - uses: cachix/install-nix-action@v15 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} if: steps.changed-files.outputs.any_changed == 'true' - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 if: steps.changed-files.outputs.any_changed == 'true' with: name: cronos @@ -74,7 +78,11 @@ jobs: files: | *.nix **/*.nix - - uses: cachix/install-nix-action@v15 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} if: steps.changed-files.outputs.any_changed == 'true' - run: nix-shell -I nixpkgs=./nix -p nixpkgs-fmt --run "make lint-nix" if: steps.changed-files.outputs.any_changed == 'true' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00760682f1..649935b971 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,15 +33,17 @@ jobs: environment: release steps: - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v16 + - uses: cachix/install-nix-action@v18 with: nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: apple-actions/import-codesign-certs@v1 if: matrix.os == 'macos-latest' with: p12-file-base64: ${{ secrets.MAC_CODE_SIGN_CERT }} p12-password: ${{ secrets.MAC_CODE_SIGN_CERT_PASS }} - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 with: name: cronos signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" @@ -90,13 +92,17 @@ jobs: runs-on: ubuntu-latest environment: release steps: - - uses: cachix/install-nix-action@v16 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - run: | DEBIAN_FRONTEND=noninteractive sudo apt-get update -q -y && sudo apt-get install -q -y qemu-system-aarch64 qemu-efi binfmt-support qemu-user-static mkdir -p ~/.config/nix sudo bash -c "echo system-features = aarch64-linux arm-linux >> /etc/nix/nix.conf" - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 with: name: cronos signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 324b8edf4a..dac8e75126 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,9 +26,13 @@ jobs: docs *.md **/*.md - - uses: cachix/install-nix-action@v15 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} if: steps.changed-files.outputs.only_changed == 'false' - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 if: steps.changed-files.outputs.only_changed == 'false' with: name: cronos @@ -67,9 +71,13 @@ jobs: docs *.md **/*.md - - uses: cachix/install-nix-action@v15 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-21.11 + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} if: steps.changed-files.outputs.only_changed == 'false' - - uses: cachix/cachix-action@v10 + - uses: cachix/cachix-action@v12 if: steps.changed-files.outputs.only_changed == 'false' with: name: cronos