From 41fda1a9f52d56578a76f8bf185db86da2128a0e Mon Sep 17 00:00:00 2001 From: Ruben Vorderman <r.h.p.vorderman@lumc.nl> Date: Wed, 9 Feb 2022 15:25:21 +0100 Subject: [PATCH] Use cache --- .github/workflows/lint.yml | 39 ++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b22d072..3386241 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,15 +19,46 @@ jobs: - uses: actions/checkout@v2.3.4 with: submodules: recursive + + - name: Set cache date + run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV + + - name: Cache conda packages + uses: actions/cache@v2.1.7 + env: + # Increase this value to manually invalidate the cache + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: + ${{runner.os}}-conda-${{ env.CACHE_NUMBER }}-${env.date}-${{ hashFiles('.github/lint-environment.yml') }} + + - name: Cache conda environment + uses: actions/cache@v2.1.7 + env: + # Increase this value to manually invalidate the cache + CACHE_NUMBER: 0 + with: + path: /usr/share/miniconda/envs/biowdl-lint + key: + ${{runner.os}}-biowdl-lint-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/lint-environment.yml') }} + id: env_cache + - name: install miniconda - uses: conda-incubator/setup-miniconda@v2.0.1 + uses: conda-incubator/setup-miniconda@v2.1.1 with: + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true channels: conda-forge,bioconda,defaults channel-priority: strict - installer-url: https://github.com/conda-forge/miniforge/releases/download/4.11.0-0/Mambaforge-4.11.0-0-Linux-x86_64.sh - # Conda-incubator uses 'test' environment by default. - - name: install requirements + auto-activate-base: false + activate-environment: biowdl-lint + + - name: Update test environment run: mamba install -n test cromwell miniwdl wdl-aid + if: steps.env_cache.outputs.cache-hit != 'true' + - name: run womtool validate run: | bash -c ' -- GitLab