Skip to content

Commit

Permalink
Revert "tidy up"
Browse files Browse the repository at this point in the history
This reverts commit 3888b4c.
  • Loading branch information
nebfield committed Jul 19, 2023
1 parent 3888b4c commit 11319d6
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 116 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ jobs:
preload_singularity:
uses: ./.github/workflows/preload-singularity.yml

standard_test:
needs: [preload_docker, preload_singularity]
standard_test_docker:
needs: preload_docker
uses: ./.github/workflows/standard-test.yml
with:
docker-cache-key: ${{ needs.preload_docker.outputs.cache-key }}
singularity-cache-key: ${{ needs.preload_singularity.outputs.cache-key }}
cache-key: ${{ needs.preload_docker.outputs.cache-key }}
docker: true

standard_test_singularity:
needs: preload_singularity
uses: ./.github/workflows/standard-test.yml
with:
cache-key: ${{ needs.preload_singularity.outputs.cache-key }}
singularity: true

43 changes: 0 additions & 43 deletions .github/workflows/standard-test-docker.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/standard-test-singularity.yml

This file was deleted.

99 changes: 85 additions & 14 deletions .github/workflows/standard-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,91 @@ name: Run standard test with singularity and docker profiles
on:
workflow_call:
inputs:
docker-cache-key:
required: true
type: string
singularity-cache-key:
required: true
cache-key:
type: string
docker:
type: boolean
singularity:
type: boolean

env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/singularity
SINGULARITY_VERSION: 3.8.3

jobs:
run_standard_docker:
uses: ./.github/workflows/standard-test-docker.yml
with:
cache-key: ${{ inputs.docker-cache-key }}

run_standard_singularity:
uses: ./.github/workflows/standard-test-singularity.yml
with:
cache-key: ${{ inputs.singularity-cache-key }}
docker:
if: ${{ inputs.docker }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_profile: ["test"]
profile: ["docker"]
nxf_ver: ['22.10.0', 'latest']

steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- uses: nf-core/setup-nextflow@v1
with:
version: ${{ matrix.nxf_ver }}

- name: Restore docker images
if: matrix.profile == 'docker'
id: restore-docker
uses: actions/cache/restore@v3
with:
path: ${{ runner.temp }}/docker
key: ${{ inputs.cache-key }}

- name: Load docker images from cache
if: steps.restore-docker.outputs.cache-hit == 'true'
run: |
find $HOME -name '*.tar'
find ${{ runner.temp }}/docker/ -name '*.tar' -exec sh -c 'docker load < {}' \;
- name: Run pipeline with test data
run: |
nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_profile}},${{ matrix.profile }}
singularity:
if: ${{ inputs.singularity }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_profile: ["test"]
profile: ["singularity"]
nxf_ver: ['22.10.0', 'latest']

steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- uses: nf-core/setup-nextflow@v1
with:
version: ${{ matrix.nxf_ver }}

- name: Restore singularity setup
id: restore-singularity-setup
uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/singularity/${{ env.SINGULARITY_VERSION }}/x64
key: ${{ runner.os }}-singularity-${{ env.SINGULARITY_VERSION }}
fail-on-cache-miss: true

- name: Add singularity to path
run: |
echo "/opt/hostedtoolcache/singularity/${{ env.SINGULARITY_VERSION }}/x64/bin" >> $GITHUB_PATH
- name: Restore singularity container images
id: restore-singularity
uses: actions/cache@v3
with:
path: ${{ env.NXF_SINGULARITY_CACHEDIR }}
key: ${{ inputs.cache_key }}

- name: Run pipeline with test data
run: |
nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_profile}},${{ matrix.profile }}

0 comments on commit 11319d6

Please sign in to comment.