From d257e325ab0a16d8bc2dc5c11ad6133b73ab97e7 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:37:21 +0200 Subject: [PATCH 1/4] Switch to conda to avoid lockfile false positives --- .github/workflows/template-check-version.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/template-check-version.yml b/.github/workflows/template-check-version.yml index b5ef426..944149f 100644 --- a/.github/workflows/template-check-version.yml +++ b/.github/workflows/template-check-version.yml @@ -22,21 +22,20 @@ jobs: with: ref: "latest" # This avoids comparing against development versions. - - name: Setup pixi - uses: prefix-dev/setup-pixi@v0.8.3 + - 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 copier, install it, and stash to avoid 'dirty' copier warnings - run: | - pixi add copier - pixi install - git stash push -m "Stash pixi lock and toml" -- pixi.lock pixi.toml - name: Add dummy GitHub credentials run: | git config --global user.name Copier update git config --global user.email check@dummy.bot.com - name: Run copier update - run: pixi run copier update --skip-answered --defaults + run: copier update --skip-answered --defaults - name: Check for template changes run: test -z "$(git status --porcelain)" || echo "UPDATE=true" >> $GITHUB_ENV From f6b990444aebebd9132c4db1f2a880a563c37c30 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:39:30 +0200 Subject: [PATCH 2/4] Run less often --- template/.github/workflows/check-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.github/workflows/check-version.yml b/template/.github/workflows/check-version.yml index 06b4587..09f5901 100644 --- a/template/.github/workflows/check-version.yml +++ b/template/.github/workflows/check-version.yml @@ -2,7 +2,7 @@ name: Template check. on: schedule: - - cron: '0 0 * * 1' # Runs at 00:00 UTC every Monday + - cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st of every month jobs: copier-update: From f5aca832f6c32acd84a135e8492f095574fb9883 Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Tue, 22 Apr 2025 10:13:25 +0200 Subject: [PATCH 3/4] Keep weekly run --- template/.github/workflows/check-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.github/workflows/check-version.yml b/template/.github/workflows/check-version.yml index 09f5901..06b4587 100644 --- a/template/.github/workflows/check-version.yml +++ b/template/.github/workflows/check-version.yml @@ -2,7 +2,7 @@ name: Template check. on: schedule: - - cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st of every month + - cron: '0 0 * * 1' # Runs at 00:00 UTC every Monday jobs: copier-update: From d8a454972e81089b37daffd5bd9b8ad6712c055e Mon Sep 17 00:00:00 2001 From: Ivan Ruiz Manuel <72193617+irm-codebase@users.noreply.github.com> Date: Tue, 22 Apr 2025 19:05:29 +0200 Subject: [PATCH 4/4] Specify cores to use in integration test --- template/tests/clio_test.py.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/tests/clio_test.py.jinja b/template/tests/clio_test.py.jinja index 5fe141b..fcd4971 100644 --- a/template/tests/clio_test.py.jinja +++ b/template/tests/clio_test.py.jinja @@ -40,7 +40,7 @@ def test_standard_file_existance(module_path, file): def test_snakemake_all_failure(module_path): """The snakemake 'all' rule should return an error by default.""" process = subprocess.run( - "snakemake", shell=True, cwd=module_path, capture_output=True + "snakemake --cores 4", shell=True, cwd=module_path, capture_output=True ) assert "INVALID (missing locally)" in str(process.stderr) @@ -48,7 +48,7 @@ def test_snakemake_all_failure(module_path): def test_snakemake_integration_testing(module_path): """Run a light-weight test simulating someone using this module.""" assert subprocess.run( - "snakemake --use-conda", + "snakemake --use-conda --cores 4", shell=True, check=True, cwd=module_path / "tests/integration",