From 5a1a8573ebd300d399a765a813102dc5954fcedb Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Fri, 15 Nov 2024 19:02:34 +0400 Subject: [PATCH 01/11] ci: fetch latest installer from hydra --- .github/workflows/test.yml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe6c6b8..51fb945 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -114,18 +114,26 @@ jobs: os: [ubuntu-latest, macos-13] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v30 - with: - nix_path: nixpkgs=channel:nixos-22.11 - install_url: https://nixos-nix-install-tests.cachix.org/serve/kkq45x7yrzvxq8627fi6hkswnfa7mg2l/install - install_options: "--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve" - - run: yarn install --frozen-lockfile - - run: yarn build - - name: Test public cache - uses: ./ - with: - name: cachix-action - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - run: nix-build test.nix + - uses: actions/checkout@v4 + + - id: latest_installer + name: Fetch latest installer from Hydra + run: | + install_url=$(curl --header 'Accept: application/json' --location \ + https://hydra.nixos.org/job/nix/master/installerScript/latest-finished \ + | jq -r '.buildproducts."1".path') + echo "install_url=$install_url" >> $GITHUB_OUTPUT + + - uses: cachix/install-nix-action@V30 + with: + install_url: ${{ steps.latest_installer.outputs.install_url }} + + - run: yarn install --frozen-lockfile + - run: yarn build + + - name: Test public cache + uses: ./ + with: + name: cachix-action + signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + - run: nix-build test.nix From 71242a1d3e4e9da748d9885eafd05efbf1d68c74 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Fri, 15 Nov 2024 19:34:51 +0400 Subject: [PATCH 02/11] fix install_url --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51fb945..074aa4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,9 +119,10 @@ jobs: - id: latest_installer name: Fetch latest installer from Hydra run: | - install_url=$(curl --header 'Accept: application/json' --location \ + build_id=$(curl --header 'Accept: application/json' --location --silent \ https://hydra.nixos.org/job/nix/master/installerScript/latest-finished \ - | jq -r '.buildproducts."1".path') + | jq -r '.id') + install_url="https:://hydra.nixos.org/build/$build_id/download/1/install" echo "install_url=$install_url" >> $GITHUB_OUTPUT - uses: cachix/install-nix-action@V30 From 289d4f828d123f70e72b9ae6194e71cdf12838cc Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Fri, 15 Nov 2024 19:37:33 +0400 Subject: [PATCH 03/11] fix install_url --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 074aa4f..09d60f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,7 +122,7 @@ jobs: build_id=$(curl --header 'Accept: application/json' --location --silent \ https://hydra.nixos.org/job/nix/master/installerScript/latest-finished \ | jq -r '.id') - install_url="https:://hydra.nixos.org/build/$build_id/download/1/install" + install_url="https://hydra.nixos.org/build/$build_id/download/1/install" echo "install_url=$install_url" >> $GITHUB_OUTPUT - uses: cachix/install-nix-action@V30 From c27f50b3de3dbf6c82153d2476bf59987819c9c6 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Fri, 15 Nov 2024 19:49:15 +0400 Subject: [PATCH 04/11] add tarball-prefix --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09d60f9..bc26345 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -128,6 +128,7 @@ jobs: - uses: cachix/install-nix-action@V30 with: install_url: ${{ steps.latest_installer.outputs.install_url }} + install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - run: yarn install --frozen-lockfile - run: yarn build From 63fc6082afba1348144b633970c82c1af25624a6 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Thu, 21 Nov 2024 23:13:08 +0400 Subject: [PATCH 05/11] ci: fetch installer directly from hydra --- .github/workflows/test.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc26345..59dd5c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -116,18 +116,9 @@ jobs: steps: - uses: actions/checkout@v4 - - id: latest_installer - name: Fetch latest installer from Hydra - run: | - build_id=$(curl --header 'Accept: application/json' --location --silent \ - https://hydra.nixos.org/job/nix/master/installerScript/latest-finished \ - | jq -r '.id') - install_url="https://hydra.nixos.org/build/$build_id/download/1/install" - echo "install_url=$install_url" >> $GITHUB_OUTPUT - - - uses: cachix/install-nix-action@V30 + - uses: cachix/install-nix-action@v30 with: - install_url: ${{ steps.latest_installer.outputs.install_url }} + install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - run: yarn install --frozen-lockfile From 0ca793ae6350fd47a3cea9f3645b3a11a7c26118 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Tue, 26 Nov 2024 20:13:20 +0400 Subject: [PATCH 06/11] ci: fetch and serve installer in nix-master test --- .github/workflows/test.yml | 39 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59dd5c6..3e36046 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,22 +111,33 @@ jobs: nix-master: strategy: matrix: - os: [ubuntu-latest, macos-13] + include: + - os: ubuntu-latest + system: x86_64-linux + - os: macos-13 + system: x86_64-darwin + - os: macos-latest + system: aarch64-darwin runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v30 - with: - install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' + - name: Run NAR server + run: | + curl --location https://github.com/sandydoo/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ matrix.system }} -O + ./nar-toolbox-${{ matrix.system }} serve & - - run: yarn install --frozen-lockfile - - run: yarn build + - uses: cachix/install-nix-action@v30 + with: + install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install + install_options: "--tarball-url-prefix https://localhost:8080" + + - run: yarn install --frozen-lockfile + - run: yarn build - - name: Test public cache - uses: ./ - with: - name: cachix-action - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - - run: nix-build test.nix + - name: Test public cache + uses: ./ + with: + name: cachix-action + signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" + - run: nix-build test.nix From b3870fe66a08ea34cde11a3167af2876718f9ecb Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Tue, 26 Nov 2024 20:19:28 +0400 Subject: [PATCH 07/11] ci: fix path to nar server --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e36046..81d087d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -130,7 +130,7 @@ jobs: - uses: cachix/install-nix-action@v30 with: install_url: https://hydra.nixos.org/job/nix/master/installerScript/latest-finished/download/1/install - install_options: "--tarball-url-prefix https://localhost:8080" + install_options: "--tarball-url-prefix http://localhost:8080" - run: yarn install --frozen-lockfile - run: yarn build From 92085e9a8d3df702ee1051afc3c8361d266705b4 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Tue, 26 Nov 2024 20:21:36 +0400 Subject: [PATCH 08/11] ci: make nar server executable --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81d087d..88d5f20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -125,6 +125,7 @@ jobs: - name: Run NAR server run: | curl --location https://github.com/sandydoo/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ matrix.system }} -O + chmod +x ./nar-toolbox-${{ matrix.system }} ./nar-toolbox-${{ matrix.system }} serve & - uses: cachix/install-nix-action@v30 From c696f33b26d49d091992050159843453c7845794 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Tue, 26 Nov 2024 20:22:46 +0400 Subject: [PATCH 09/11] ci: set cache to serve from --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88d5f20..7a54929 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -126,7 +126,7 @@ jobs: run: | curl --location https://github.com/sandydoo/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ matrix.system }} -O chmod +x ./nar-toolbox-${{ matrix.system }} - ./nar-toolbox-${{ matrix.system }} serve & + ./nar-toolbox-${{ matrix.system }} serve https://cache.nixos.org & - uses: cachix/install-nix-action@v30 with: From aab124d540676a32cd7b019b22961353c5ee4c98 Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Fri, 6 Dec 2024 01:18:53 +0400 Subject: [PATCH 10/11] ci: bump nixpkgs --- test.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.nix b/test.nix index 54ea888..61143b7 100644 --- a/test.nix +++ b/test.nix @@ -5,7 +5,7 @@ currentTime ? builtins.currentTime, }: -with (import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11") { }); +with (import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11") { }); let drv = From bc8eb25217196db45fb9e1ce8fd5b7a935216f5d Mon Sep 17 00:00:00 2001 From: Sander <hey@sandydoo.me> Date: Tue, 31 Dec 2024 12:47:42 +0400 Subject: [PATCH 11/11] ci: update url to nar-toolbox --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a54929..d2c81c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,7 +124,7 @@ jobs: - name: Run NAR server run: | - curl --location https://github.com/sandydoo/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ matrix.system }} -O + curl --location https://github.com/cachix/nar-toolbox/releases/download/v0.1.0/nar-toolbox-${{ matrix.system }} -O chmod +x ./nar-toolbox-${{ matrix.system }} ./nar-toolbox-${{ matrix.system }} serve https://cache.nixos.org &