From b81a1d5d5c3d1a15bdb0f1b25973f506868ddf12 Mon Sep 17 00:00:00 2001 From: Benjamin Wingfield Date: Thu, 20 Jul 2023 11:29:09 +0100 Subject: [PATCH] fix preload --- .github/workflows/ancestry.yml | 11 +++++++---- .github/workflows/preload-reference.yml | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ancestry.yml b/.github/workflows/ancestry.yml index 78af620b..ca44aa79 100644 --- a/.github/workflows/ancestry.yml +++ b/.github/workflows/ancestry.yml @@ -17,15 +17,18 @@ on: env: NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/singularity SINGULARITY_VERSION: 3.8.3 - ANCESTRY_REF_DIR: ${{ env.runner_temp }} - ANCESTRY_TARGET_DIR: ${{ env.runner_temp }} jobs: docker: if: ${{ inputs.docker }} runs-on: ubuntu-latest - steps: + steps: + - name: Set environment variables + run: | + echo "ANCESTRY_REF_DIR=$RUNNER_TEMP" >> $GITHUB_ENV + echo "ANCESTRY_TARGET_DIR=$RUNNER_TEMP" >> $GITHUB_ENV + - name: Check out pipeline code uses: actions/checkout@v3 @@ -37,7 +40,7 @@ jobs: uses: actions/cache/restore@v3 with: path: ${{ runner.temp }}/docker - key: ${{ inputs.cache-key }} + key: ${{ inputs.container-cache-key }} fail-on-cache-miss: true - name: Load docker images from cache diff --git a/.github/workflows/preload-reference.yml b/.github/workflows/preload-reference.yml index 48b642d9..4c041d8a 100644 --- a/.github/workflows/preload-reference.yml +++ b/.github/workflows/preload-reference.yml @@ -5,24 +5,19 @@ on: outputs: cache-key: value: ancestry - -env: - ANCESTRY_REF_DIR: ${{ env.RUNNER_TEMP }} - ANCESTRY_TARGET_DIR: ${{ env.RUNNER_TEMP }} jobs: preload_reference: runs-on: ubuntu-latest steps: - - name: Download reference data + - name: Set environment variables run: | - wget -qnc -P $ANCESTRY_REF_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_reference.tar.zst - wget -qnc -P $ANCESTRY_TARGET_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_target.tar.zst - tar -xf $ANCESTRY_TARGET_DIR/GRCh38_HAPNEST_target.tar.zst -C $ANCESTRY_TARGET_DIR - + echo "ANCESTRY_REF_DIR=$RUNNER_TEMP" >> $GITHUB_ENV + echo "ANCESTRY_TARGET_DIR=$RUNNER_TEMP" >> $GITHUB_ENV + - name: Cache reference data id: cache-ref - uses: actions/cache/save@v3 + uses: actions/cache@v3 with: path: | ${{ env.ANCESTRY_TARGET_DIR }}/GRCh38_HAPNEST_TARGET_ALL.pgen @@ -30,3 +25,11 @@ jobs: ${{ env.ANCESTRY_TARGET_DIR }}/GRCh38_HAPNEST_TARGET_ALL.pvar.zst ${{ env.ANCESTRY_REF_DIR }}/GRCh38_HAPNEST_reference.tar.zst key: ancestry + + - name: Download reference data + if: steps.cache-ref.outputs.cache-hit != 'true' + run: | + wget -qnc -P $ANCESTRY_REF_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_reference.tar.zst + wget -qnc -P $ANCESTRY_TARGET_DIR https://ftp.ebi.ac.uk/pub/databases/spot/pgs/resources/GRCh38_HAPNEST_target.tar.zst + tar -xf $ANCESTRY_TARGET_DIR/GRCh38_HAPNEST_target.tar.zst -C $ANCESTRY_TARGET_DIR +