From a65958bdfc749fc06950e0189fe30d0793516682 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 13:38:55 +0200 Subject: [PATCH 01/12] Setup a branch to test the workflow using `act` --- .github/workflows/template-check-version.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index b4969d3..1aa37cc 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -16,7 +16,7 @@ jobs: contents: read issues: write env: - UPDATE: "false" + UPDATE: false steps: - uses: actions/checkout@v4 @@ -35,11 +35,17 @@ jobs: - name: Run copier update run: copier update --skip-answered --defaults - - name: Check for template changes + - name: Wait a bit for copier cleanups + run: sleep 10s + + - name: Display differences + run: git status --porcelain + + - name: Set update flag if changes occured run: test -z "$(git status --porcelain)" || echo "UPDATE=true" >> $GITHUB_ENV - name: Open issue - if: env.UPDATE == 'true' + if: env.UPDATE == true run: | gh issue --repo ${{ github.repository }} \ create --title "Template update" \ From 044696b432141c2dd043b19e52e1d4d3f1be488f Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 13:42:02 +0200 Subject: [PATCH 02/12] Add mamba activation --- .github/workflows/template-check-version.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 1aa37cc..2736cce 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -27,6 +27,9 @@ jobs: post-cleanup: all cache-environment: true + - name: Activate mamba environment + run: mamba activate ${{ github.event.repository.name }}-copier + - name: Add dummy GitHub credentials run: | git config --global user.name Copier update From 2b83caed386929d174a79d4176c89ab8d512ac4d Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 14:00:24 +0200 Subject: [PATCH 03/12] Remove activation --- .github/workflows/template-check-version.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 2736cce..1aa37cc 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -27,9 +27,6 @@ jobs: post-cleanup: all cache-environment: true - - name: Activate mamba environment - run: mamba activate ${{ github.event.repository.name }}-copier - - name: Add dummy GitHub credentials run: | git config --global user.name Copier update From 77616f18ba76b1d42b30657e4091c476e10efe7a Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 14:08:50 +0200 Subject: [PATCH 04/12] Show environment variables for easier debugging --- .github/workflows/template-check-version.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 1aa37cc..2b5928b 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -44,6 +44,10 @@ jobs: - name: Set update flag if changes occured run: test -z "$(git status --porcelain)" || echo "UPDATE=true" >> $GITHUB_ENV + - name: Show environment variables + run: | + echo "$UPDATE" + - name: Open issue if: env.UPDATE == true run: | From e7b0ea736911142b7dc13224eb986d54742169db Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 14:36:48 +0200 Subject: [PATCH 05/12] Replace mamba with pixi and avoid local environment installation --- .github/workflows/template-check-version.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 2b5928b..9490b59 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -20,18 +20,22 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v2 - with: - environment-name: ${{ github.event.repository.name }}-copier - create-args: copier python=3.12 - post-cleanup: all - cache-environment: true - - name: Add dummy GitHub credentials run: | git config --global user.name Copier update git config --global user.email check@dummy.bot.com + - uses: prefix-dev/setup-pixi@v0.8.8 + with: + cache: true + pixi-bin-path: ${{ runner.temp }}/bin/pixi + pixi-version: v0.44.0 + run-install: false + post-cleanup: true + + - name: Add copier + run: pixi global install copier + - name: Run copier update run: copier update --skip-answered --defaults From 6b5a9f94480a28f23b2e8fc57d55b82f00141565 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 14:38:13 +0200 Subject: [PATCH 06/12] No cache --- .github/workflows/template-check-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 9490b59..8bb0bc0 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -27,7 +27,7 @@ jobs: - uses: prefix-dev/setup-pixi@v0.8.8 with: - cache: true + cache: false pixi-bin-path: ${{ runner.temp }}/bin/pixi pixi-version: v0.44.0 run-install: false From 32e309285bdff6b5278f87d66b1f79f40938dab0 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 14:48:27 +0200 Subject: [PATCH 07/12] pixi install local but in different location --- .github/workflows/template-check-version.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 8bb0bc0..9d0eab0 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -27,14 +27,14 @@ jobs: - uses: prefix-dev/setup-pixi@v0.8.8 with: - cache: false + cache: true pixi-bin-path: ${{ runner.temp }}/bin/pixi pixi-version: v0.44.0 - run-install: false + run-install: true post-cleanup: true - name: Add copier - run: pixi global install copier + run: pixi add copier - name: Run copier update run: copier update --skip-answered --defaults From 55c5bf005a777e02c2d0f1065268f98fef567094 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:05:19 +0200 Subject: [PATCH 08/12] Move back to pixi --- .github/workflows/template-check-version.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 9d0eab0..6891db5 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -25,7 +25,8 @@ jobs: git config --global user.name Copier update git config --global user.email check@dummy.bot.com - - uses: prefix-dev/setup-pixi@v0.8.8 + - name: Setup pixi + uses: prefix-dev/setup-pixi@v0.8.8 with: cache: true pixi-bin-path: ${{ runner.temp }}/bin/pixi @@ -33,11 +34,10 @@ jobs: run-install: true post-cleanup: true - - name: Add copier - run: pixi add copier + - run: pixi add copier - name: Run copier update - run: copier update --skip-answered --defaults + run: pixi run copier update --skip-answered --defaults - name: Wait a bit for copier cleanups run: sleep 10s From fb7f48fcf1d2cbfe9685742d687dc827051302a8 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:22:05 +0200 Subject: [PATCH 09/12] Add pixi stash --- .github/workflows/template-check-version.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 6891db5..1ad6422 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -34,7 +34,12 @@ jobs: run-install: true post-cleanup: true - - run: pixi add copier + # Stash hides modifications to pixi.lock / pixi.toml caused by adding copier + - name: Setup copier + run: | + pixi add copier + git stash + git stash clear - name: Run copier update run: pixi run copier update --skip-answered --defaults From b32b9e35e4796cefb5b5f9e245ffcf805ec47a9f Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:25:28 +0200 Subject: [PATCH 10/12] pixi activate environment --- .github/workflows/template-check-version.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 1ad6422..795b4b1 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -33,6 +33,7 @@ jobs: pixi-version: v0.44.0 run-install: true post-cleanup: true + activate-environment: true # Stash hides modifications to pixi.lock / pixi.toml caused by adding copier - name: Setup copier @@ -42,7 +43,7 @@ jobs: git stash clear - name: Run copier update - run: pixi run copier update --skip-answered --defaults + run: copier update --skip-answered --defaults - name: Wait a bit for copier cleanups run: sleep 10s From 0b23e6266a28eca690df79af04100a3fcd73c083 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:39:04 +0200 Subject: [PATCH 11/12] Use uv in the workflow --- .github/workflows/template-check-version.yml | 22 ++++---------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 795b4b1..6b56b3d 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -20,30 +20,16 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Add dummy GitHub credentials run: | git config --global user.name Copier update git config --global user.email check@dummy.bot.com - - name: Setup pixi - uses: prefix-dev/setup-pixi@v0.8.8 - with: - cache: true - pixi-bin-path: ${{ runner.temp }}/bin/pixi - pixi-version: v0.44.0 - run-install: true - post-cleanup: true - activate-environment: true - - # Stash hides modifications to pixi.lock / pixi.toml caused by adding copier - - name: Setup copier - run: | - pixi add copier - git stash - git stash clear - - name: Run copier update - run: copier update --skip-answered --defaults + run: uvx copier update --skip-answered --defaults - name: Wait a bit for copier cleanups run: sleep 10s From 8008987c942ac73d746b6f92a7d47883dbf8d93a Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:57:41 +0200 Subject: [PATCH 12/12] Fix typo --- .github/workflows/template-check-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index 6b56b3d..d7f6e3f 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -37,7 +37,7 @@ jobs: - name: Display differences run: git status --porcelain - - name: Set update flag if changes occured + - name: Set update flag if changes occurred run: test -z "$(git status --porcelain)" || echo "UPDATE=true" >> $GITHUB_ENV - name: Show environment variables