Hifiadapterfilt #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run nf-tests | |
on: | |
pull_request: | |
branches: [main] | |
env: | |
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity | |
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity | |
jobs: | |
nf-test-changes: | |
name: nf-test-changes | |
runs-on: ubuntu-latest | |
outputs: | |
# Expose detected tags as 'modules' and 'workflows' output variables | |
paths: ${{ steps.list.outputs.components }} | |
modules: ${{ steps.outputs.outputs.modules }} | |
subworkflows: ${{ steps.outputs.outputs.subworkflows}} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
fetch-depth: 0 | |
- name: List nf-test files | |
id: list | |
uses: adamrtalbot/detect-nf-test-changes@7c8be3ffd0d6538312b363c8c949dbbf5f26c3dd # v0.0.4 | |
with: | |
head: ${{ github.sha }} | |
base: ${{ github.event.pull_request.base.sha }} | |
n_parents: 2 | |
- name: Separate modules and subworkflows | |
id: outputs | |
run: | | |
echo modules=$(echo '${{ steps.list.outputs.components }}' | jq -c '. | map(select(contains("modules"))) | map(gsub("modules/nf-core/"; ""))') >> $GITHUB_OUTPUT | |
echo subworkflows=$(echo '${{ steps.list.outputs.components }}' | jq '. | map(select(contains("subworkflows"))) | map(gsub("subworkflows/nf-core/"; ""))') >> $GITHUB_OUTPUT | |
- name: debug | |
run: | | |
echo ${{ steps.outputs.outputs.modules }} | |
echo ${{ steps.outputs.outputs.subworkflows }} | |
nf-test: | |
runs-on: ubuntu-latest | |
name: nf-test | |
needs: [nf-test-changes] | |
if: ( needs.nf-test-changes.outputs.paths != '[]' ) | |
strategy: | |
fail-fast: false | |
matrix: | |
path: ["${{ fromJson(needs.nf-test-changes.outputs.paths) }}"] | |
profile: [singularity] | |
env: | |
NXF_ANSI_LOG: false | |
NFTEST_VER: "0.9.0" | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Setup Nextflow | |
uses: nf-core/setup-nextflow@v2 | |
- name: Install nf-test | |
uses: nf-core/setup-nf-test@v1 | |
with: | |
version: ${{ env.NFTEST_VER }} | |
- name: Setup apptainer | |
if: matrix.profile == 'singularity' | |
uses: eWaterCycle/setup-apptainer@main | |
- name: Set up Singularity | |
if: matrix.profile == 'singularity' | |
run: | | |
mkdir -p $NXF_SINGULARITY_CACHEDIR | |
mkdir -p $NXF_SINGULARITY_LIBRARYDIR | |
- name: Set up Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5 | |
with: | |
python-version: "3.11" | |
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
id: cache-pip-pdiff | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-pdiff | |
restore-keys: | | |
${{ runner.os }}-pip-pdiff | |
- name: Install Python dependencies | |
run: python -m pip install --upgrade pip pdiff cryptography | |
# Test the module | |
- name: Run nf-test | |
env: | |
NFT_DIFF: "pdiff" | |
NFT_DIFF_ARGS: "--line-numbers --width 120 --expand-tabs=2" | |
run: | | |
PROFILE=${{ matrix.profile }} | |
NFT_WORKDIR=~ \ | |
nf-test test \ | |
--profile=${{ matrix.profile }} \ | |
--tap=test.tap \ | |
--verbose \ | |
${{ matrix.path }} | |
- uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 | |
with: | |
path: >- | |
test.tap | |
- name: Clean up | |
if: always() | |
run: | | |
sudo rm -rf /home/ubuntu/tests/ |