From ad3b0db0d7b1963f8cf6e37099718a206ccd9f11 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 8 Oct 2026 01:41:33 +0300 Subject: [PATCH 1/3] ci: overlap Rust and Nix setup --- .github/actions/prepare-nix/action.yml | 21 +++++++++++++++++++++ .github/workflows/ci.yml | 11 +++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/actions/prepare-nix/action.yml diff --git a/.github/actions/prepare-nix/action.yml b/.github/actions/prepare-nix/action.yml new file mode 100644 index 0000000..c3bdae0 --- /dev/null +++ b/.github/actions/prepare-nix/action.yml @@ -0,0 +1,21 @@ +name: Prepare Nix devshell +description: Install Nix and prepare the selected devshell. + +inputs: + devshell: + description: Flake devshell to prepare. + required: false + default: . + +runs: + using: composite + steps: + - name: Install Nix + uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35 + + - name: Prepare Nix devshell + shell: bash + env: + DEVSHELL: ${{ inputs.devshell }} + run: | + "$HOME/.nix-profile/bin/nix" develop "$DEVSHELL" --command true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef4022e..3536fb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,14 +41,21 @@ jobs: with: persist-credentials: false - - name: Install Nix - uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35 + - name: Prepare Nix devshell + id: devshell + background: true + uses: $/.github/actions/prepare-nix + with: + devshell: .#ci - name: Install Rust (${{ matrix.toolchain.name }}) uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: toolchain: ${{ matrix.toolchain.version }} + - name: Wait for Nix devshell preparation + wait: devshell + - name: Enter Nix Devshell uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 with: From 8876c43b79a837dff236e2920efdaf54e7c300c6 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 8 Oct 2026 02:53:12 +0300 Subject: [PATCH 2/3] ci: use nix-develop action for parallel shell setup --- .github/actions/prepare-nix/action.yml | 16 +++++++--------- .github/workflows/ci.yml | 9 ++------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/actions/prepare-nix/action.yml b/.github/actions/prepare-nix/action.yml index c3bdae0..4810ced 100644 --- a/.github/actions/prepare-nix/action.yml +++ b/.github/actions/prepare-nix/action.yml @@ -1,9 +1,9 @@ -name: Prepare Nix devshell -description: Install Nix and prepare the selected devshell. +name: Set up Nix devshell +description: Install Nix and enter the selected devshell. inputs: devshell: - description: Flake devshell to prepare. + description: Flake devshell to enter. required: false default: . @@ -13,9 +13,7 @@ runs: - name: Install Nix uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35 - - name: Prepare Nix devshell - shell: bash - env: - DEVSHELL: ${{ inputs.devshell }} - run: | - "$HOME/.nix-profile/bin/nix" develop "$DEVSHELL" --command true + - name: Enter Nix devshell + uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 + with: + arguments: ${{ inputs.devshell }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3536fb9..c8f5a3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: with: persist-credentials: false - - name: Prepare Nix devshell + - name: Set up Nix devshell id: devshell background: true uses: $/.github/actions/prepare-nix @@ -53,14 +53,9 @@ jobs: with: toolchain: ${{ matrix.toolchain.version }} - - name: Wait for Nix devshell preparation + - name: Wait for Nix devshell wait: devshell - - name: Enter Nix Devshell - uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 - with: - arguments: .#ci - - name: Workaround MSRV issues if: matrix.toolchain.name == 'msrv' run: just downgrade-for-msrv From 9b20bde35840cb3bd8c4650e78f1978f4b196615 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 8 Oct 2026 04:26:00 +0300 Subject: [PATCH 3/3] ci: inline parallel Rust and Nix setup --- .github/actions/prepare-nix/action.yml | 19 ------------------- .github/workflows/ci.yml | 22 +++++++++++++++------- 2 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 .github/actions/prepare-nix/action.yml diff --git a/.github/actions/prepare-nix/action.yml b/.github/actions/prepare-nix/action.yml deleted file mode 100644 index 4810ced..0000000 --- a/.github/actions/prepare-nix/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Set up Nix devshell -description: Install Nix and enter the selected devshell. - -inputs: - devshell: - description: Flake devshell to enter. - required: false - default: . - -runs: - using: composite - steps: - - name: Install Nix - uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35 - - - name: Enter Nix devshell - uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 - with: - arguments: ${{ inputs.devshell }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8f5a3d..dc44095 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,18 +41,26 @@ jobs: with: persist-credentials: false - - name: Set up Nix devshell - id: devshell - background: true - uses: $/.github/actions/prepare-nix - with: - devshell: .#ci - - name: Install Rust (${{ matrix.toolchain.name }}) + id: rust + background: true uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0 with: toolchain: ${{ matrix.toolchain.version }} + - name: Install Nix + uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35 + + - name: Enter Nix devshell + id: devshell + background: true + uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 + with: + arguments: .#ci + + - name: Wait for Rust + wait: rust + - name: Wait for Nix devshell wait: devshell