From f36ed3f516cd282f0d08c8c17ba6171be3580832 Mon Sep 17 00:00:00 2001 From: DLBPointon Date: Thu, 4 Apr 2024 12:22:52 +0100 Subject: [PATCH] Add pre-fetch for the containers in ascc with nf-download --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdce0f5..f0675ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,8 @@ on: env: NXF_ANSI_LOG: false + NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity + NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity concurrency: group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" @@ -27,6 +29,12 @@ jobs: - "22.10.1" - "latest-everything" steps: + - name: Get branch names + # Pulls the names of current branches in repo + # steps.branch-names.outputs.current_branch is used later and returns the name of the branch the PR is made FROM not to + id: branch-names + uses: tj-actions/branch-names@v8 + - name: Check out pipeline code uses: actions/checkout@v3 @@ -35,6 +43,27 @@ jobs: with: version: "${{ matrix.NXF_VER }}" + - name: Set up Singularity + run: | + mkdir -p $NXF_SINGULARITY_CACHEDIR + mkdir -p $NXF_SINGULARITY_LIBRARYDIR + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install nf-core + run: | + pip install nf-core + + - name: NF-Core Download - download singularity containers + # Forcibly download repo on active branch and download SINGULARITY containers into the CACHE dir if not found + # Must occur after singularity install or will crash trying to dl containers + # Zip up this fresh download and run the checked out version + run: | + nf-core download sanger-tol/ascc --revision ${{ steps.branch-names.outputs.current_branch }} --compress none -d --force --outdir sanger-ascc --container-cache-utilisation amend --container-system docker + - name: Download test data # Download A fungal test data set that is full enough to show some real output. run: | @@ -89,7 +118,7 @@ jobs: mkdir vecscreen curl -L https://ftp.ncbi.nlm.nih.gov/blast/db/v4/16SMicrobial_v4.tar.gz | tar -C vecscreen -xzf - - - name: Run pipeline with test data + - name: Singularity - Run FULL pipeline with test data # TODO nf-core: You can customise CI pipeline run tests as required # For example: adding multiple test runs with different parameters # Remember that you can parallelise this by using strategy.matrix