Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate CI tests to nf-test #883

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
98601db
ci: Yoink current ci from sarek
edmundmiller Oct 10, 2022
3874774
test: Copy tests from old pytest-workflow branch
edmundmiller Oct 10, 2022
c0ec02f
ci: Add a few tags
edmundmiller Oct 10, 2022
8a5f904
ci: Reduce test runs
edmundmiller Oct 10, 2022
c175aef
test: Add --outdir
edmundmiller Oct 10, 2022
263719c
test: Update default md5sums
edmundmiller Oct 10, 2022
bb4d75c
test: Remove md5sums for bams in default
edmundmiller Oct 10, 2022
7c5bcc7
ci: Only test on docker for now
edmundmiller Oct 10, 2022
d7b3deb
ci: Remove broken test
edmundmiller Oct 10, 2022
ff99fac
chore: Update CHANGELOG
edmundmiller Oct 10, 2022
967ed57
ci: Add pytest for tags
edmundmiller Oct 10, 2022
e892f51
style: Rename pipeline tests to their own dir
edmundmiller Oct 10, 2022
e1258b4
test: Add star tag
edmundmiller Oct 10, 2022
a5c3a97
test: Add quantify_salmon to full workflow tests
edmundmiller Oct 11, 2022
cfaa74a
ci: Use a seperate workflow for pytest-workflow
edmundmiller Oct 11, 2022
96e275c
ci: Add code checkout
edmundmiller Oct 11, 2022
d63d6cb
test: Clean up and confirm they're up to date with current CI
edmundmiller Oct 11, 2022
9d55816
test: Add tag paths
edmundmiller Oct 11, 2022
acecd8e
ci: Add a release CI that runs all of the tests on release
edmundmiller Oct 11, 2022
08d1560
ci: Add in profile discovery
edmundmiller Oct 11, 2022
7431d51
ci: Remove release fail-fast
edmundmiller Oct 11, 2022
987720a
ci: Fix docker profile
edmundmiller Oct 11, 2022
03650ba
ci: Remove retries
edmundmiller Oct 11, 2022
adbae6a
ci: Add quotes
edmundmiller Oct 11, 2022
4c6be70
ci: tmp => home
edmundmiller Oct 11, 2022
1579a1a
ci: apt => apt-get
edmundmiller Oct 11, 2022
8ff17cc
ci: Redo triggers
edmundmiller Oct 11, 2022
7e3d955
ci: Remove fail-fast which is true by default
edmundmiller Oct 11, 2022
40643e9
style: Ignore actions ci triggering in linting
edmundmiller Oct 11, 2022
55cf7f2
test: Mark STAR Salmon with remove_ribo_rna as passing
edmundmiller Oct 12, 2022
92733f8
build: Run nf-test init
edmundmiller Nov 5, 2022
83f0436
test(nf-test): Add initial hisat2 tests
edmundmiller Nov 4, 2022
02a30af
test(nf-test): Move salmon tests
edmundmiller Nov 7, 2022
8481a29
test(nf-test): Move star_rsem tests over
edmundmiller Nov 7, 2022
f47a072
test(nf-test): Move star_salmon over
edmundmiller Nov 7, 2022
db27489
test(nf-test): Move default tests over
edmundmiller Nov 7, 2022
778f058
ci: Copy ci from methylseq
edmundmiller Nov 7, 2022
24c0a2f
ci: Add pipeline, subworkflows, and modules test based on changes
edmundmiller Nov 7, 2022
188f1e5
ci: Comment out subworkflows and modules for now
edmundmiller Nov 7, 2022
f64a6e3
ci: tap => junitxml
edmundmiller Nov 7, 2022
bbcef6f
test(default): Remove snapshot
edmundmiller Nov 7, 2022
a11181f
ci: Remove release for now
edmundmiller Nov 7, 2022
ea8215e
chore: Update CHANGELOG
edmundmiller Nov 7, 2022
4b16f38
chore: Remove PROFILE hack as nf-test has first-class support for pro…
edmundmiller Nov 7, 2022
81963db
test(nf-test): Move quantify_rsem tests over
edmundmiller Nov 7, 2022
5d4bf8b
test(nf-test): Migrate quantify_salmon
edmundmiller Nov 7, 2022
00ed9b1
test(nf-test): Remove local in subworkflows
edmundmiller Nov 7, 2022
08a4caa
test(subworkflows): Add input_check test
edmundmiller Nov 7, 2022
05df41c
test(modules): Add basic samplesheet_check
edmundmiller Nov 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 61 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: nf-core CI
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on:
push:
pull_request:
branches:
- dev
pull_request:
release:
types: [published]

Expand All @@ -13,7 +12,7 @@ env:

jobs:
test:
name: Run pipeline with test data
name: Run default pipeline test
# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}"
runs-on: ubuntu-latest
Expand All @@ -22,113 +21,79 @@ jobs:
NXF_VER:
- "21.10.3"
- "latest-everything"
test:
- "default"
profile: ["docker"]
exclude:
- NXF_VER: "latest-everything"
profile: "conda"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
version: "${{ matrix.NXF_VER }}"

- name: Run pipeline with test data
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results

star_salmon:
name: Test STAR Salmon with workflow parameters
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}
runs-on: ubuntu-latest
strategy:
matrix:
parameters:
- "--skip_qc"
- "--skip_trimming"
- "--gtf false"
- "--star_index false"
- "--transcript_fasta false"
- "--min_mapped_reads 90"
- "--with_umi"
- "--with_umi --skip_trimming"
- "--remove_ribo_rna --skip_qualimap"
- "--bam_csi_index"
- "--save_align_intermeds --save_reference"
- "--featurecounts_group_type false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
python-version: "3.x"

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Run pipeline with STAR and various parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner star_salmon ${{ matrix.parameters }} --outdir ./results
- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow

star_rsem:
name: Test STAR RSEM with workflow parameters
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}
runs-on: ubuntu-latest
strategy:
matrix:
parameters:
- "--skip_qc"
- "--rsem_index false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: /usr/local/bin/nextflow
key: ${{ runner.os }}
restore-keys: |
${{ runner.os }}-nextflow-

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Run pipeline with RSEM STAR and various parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner star_rsem ${{ matrix.parameters }} --outdir ./results
uses: nf-core/setup-nextflow@v1
with:
version: "${{ matrix.NXF_VER }}"

hisat2:
name: Test HISAT2 with workflow parameters
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}
runs-on: ubuntu-latest
strategy:
matrix:
parameters:
- "--skip_qc"
- "--hisat2_index false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
- name: Set up Singularity
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-singularity@v5
with:
singularity-version: 3.7.1

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: Set up miniconda
if: matrix.profile == 'conda'
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,bioconda,defaults
python-version: ${{ matrix.python-version }}

- name: Run pipeline with HISAT2 and various parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner hisat2 ${{ matrix.parameters }} --outdir ./results
- name: Conda clean
if: matrix.profile == 'conda'
run: conda clean -a

salmon:
name: Test Salmon with workflow parameters
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}
runs-on: ubuntu-latest
strategy:
matrix:
parameters:
- "--skip_qc --skip_alignment"
- "--salmon_index false --transcript_fasta false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
- name: Run pipeline with tests settings
run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag default --symlink --kwdof --git-aware --color=yes

- name: Install Nextflow
- name: Output log on failure
if: failure()
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
sudo apt-get install bat > /dev/null
batcat --decorations=always --color=always /home/runner/pytest_workflow_*/*/log.{out,err}

- name: Run pipeline with Salmon and various parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --pseudo_aligner salmon ${{ matrix.parameters }} --outdir ./results
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.profile }}
path: |
/home/runner/pytest_workflow_*/*/.nextflow.log
/home/runner/pytest_workflow_*/*/log.out
/home/runner/pytest_workflow_*/*/log.err
/home/runner/pytest_workflow_*/*/work
!/home/runner/pytest_workflow_*/*/work/conda
!/home/runner/pytest_workflow_*/*/work/singularity
109 changes: 109 additions & 0 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: pytest-workflow
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on:
pull_request:
branches:
- dev

env:
NXF_ANSI_LOG: false

jobs:
changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'modules' output variable
tags: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v2

- uses: dorny/paths-filter@v2
id: filter
with:
filters: "tests/config/pytest_tags.yml"

test_changes:
name: ${{ matrix.tags }} ${{ matrix.profile }}
runs-on: ubuntu-20.04
needs: changes
if: needs.changes.outputs.tags != '[]'
strategy:
fail-fast: false
matrix:
tags: ["${{ fromJson(needs.changes.outputs.tags) }}"]
profile: ["docker"] # TODO Add singularity/conda
steps:
- name: Check out pipeline code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow

- uses: actions/cache@v2
with:
path: /usr/local/bin/nextflow
key: ${{ runner.os }}
restore-keys: |
${{ runner.os }}-nextflow-

- name: Install Nextflow
env:
CAPSULE_LOG: none
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Set up Singularity
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-singularity@v5
with:
singularity-version: 3.7.1

- name: Set up miniconda
if: matrix.profile == 'conda'
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,bioconda,defaults
python-version: ${{ matrix.python-version }}

- name: Conda clean
if: matrix.profile == 'conda'
run: conda clean -a

# Test the module
- name: Run pytest-workflow
# only use one thread for pytest-workflow to avoid race condition on conda cache.
run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof --git-aware --color=yes

- name: Output log on failure
if: failure()
run: |
sudo apt-get install bat > /dev/null
batcat --decorations=always --color=always /home/runner/pytest_workflow_*/*/log.{out,err}

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.profile }}
path: |
/home/runner/pytest_workflow_*/*/.nextflow.log
/home/runner/pytest_workflow_*/*/log.out
/home/runner/pytest_workflow_*/*/log.err
/home/runner/pytest_workflow_*/*/work
!/home/runner/pytest_workflow_*/*/work/conda
!/home/runner/pytest_workflow_*/*/work/singularity
Loading