Skip to content

Commit

Permalink
ci: improve update pins job (#1344)
Browse files Browse the repository at this point in the history
* ci: improve update pins job

* fix pre-commit

* Restore workflow_dispatch
  • Loading branch information
lkstrp authored Feb 7, 2025
1 parent 1824702 commit 29a2e2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/update-pinned-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
push:
paths:
- envs/environment.yaml
# Run every Sunday at 5:00 UTC
schedule:
- cron: "0 5 * * 0"
- cron: "0 8 1,16 * *" # Bi-weekly
workflow_dispatch:

env:
BASE_ENV: envs/environment.yaml

jobs:
update-pinned-environment:
# the update is always needed for env changes in main and sometimes for other branches
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
name: Update pinned envs
runs-on: ${{ matrix.os }}-latest
Expand All @@ -35,11 +35,12 @@ jobs:
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ${{ github.event.repository.name }}
environment-file: envs/environment.yaml
channels: bioconda,conda-forge,defaults
environment-file: ${{ env.BASE_ENV }}

- name: Update pinned environment per OS
run: |
conda env export --name ${{ github.event.repository.name }} --no-builds > envs/${{ matrix.suffix }}-pinned.yaml
conda env export --name ${{ github.event.repository.name }} --no-builds -c conda-forge -c bioconda --override-channels > envs/${{ matrix.suffix }}-pinned.yaml
- name: Add SPDX header
if: ${{ matrix.suffix != 'windows' }}
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ repos:
rev: v2.14.0
hooks:
- id: pretty-format-yaml
exclude: pinned\.yaml$
args: [--autofix, --indent, '2', --preserve-quotes]

# Use yamllint to check for valid YAML files and list syntax errors
Expand Down

0 comments on commit 29a2e2b

Please sign in to comment.