Skip to content

Commit

Permalink
only update when there's no cache hit
Browse files Browse the repository at this point in the history
  • Loading branch information
tedil committed Dec 11, 2024
1 parent 95dae59 commit b8d134a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
27 changes: 10 additions & 17 deletions .github/actions/conda-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ inputs:
environment-file:
required: true
type: string
environment-name:
required: true
type: string
conda-rc:
required: false
type: string
cache-number:
required: false
type: number
Expand All @@ -25,19 +19,18 @@ defaults:
runs:
using: "composite"
steps:
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ci_test_conda

- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ inputs.cache-number }}-${{ hashFiles(inputs.environment-file) }}
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ inputs.python-version }} # ignore python version for now
environment-file: ${{ inputs.environment-file }}
channels: conda-forge,bioconda,nodefaults
channel-priority: strict
use-only-tar-bz2: true
condarc-file: ${{ inputs.conda-rc }}
activate-environment: ${{ inputs.environment-name }}
id: cache

- name: Update conda environment
if: steps.cache.outputs.cache-hit != 'true'
run: conda env update -n ci_test_conda -f ${{ inputs.environment-file }}
4 changes: 0 additions & 4 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
environment-name: snappy_env
conda-rc: .ci.condarc

- name: Test workflow (local FASTQs)
uses: snakemake/snakemake-github-action@cebcb23c87aa3a23efddff3f79b3a4bd143d4120
Expand Down Expand Up @@ -91,8 +89,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
environment-name: snappy_env
conda-rc: .ci.condarc

- name: Test workflow (local FASTQs)
uses: snakemake/snakemake-github-action@cebcb23c87aa3a23efddff3f79b3a4bd143d4120
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
environment-name: snappy_env
conda-rc: .ci.condarc

- name: Install dependencies
run: |
Expand Down Expand Up @@ -80,8 +78,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
environment-name: snappy_env
conda-rc: .ci.condarc

- run: which pip
- name: Install some more dependencies via pip
Expand Down

0 comments on commit b8d134a

Please sign in to comment.