Skip to content

Commit

Permalink
Merge pull request #341 from nf-core/fromSamplesheet
Browse files Browse the repository at this point in the history
Use fromSamplesheet
  • Loading branch information
edmundmiller authored Aug 28, 2023
2 parents 16007cf + 0cd09ec commit 89b0aa4
Show file tree
Hide file tree
Showing 12 changed files with 556 additions and 253 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,58 +21,59 @@ concurrency:
cancel-in-progress: true

jobs:
define_nxf_versions:
name: Choose nextflow versions to test against depending on target branch
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.nxf_versions.outputs.matrix }}
steps:
- id: nxf_versions
run: |
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT
else
echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT
fi
test:
name: Run pipeline with test data
needs: define_nxf_versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
aligner:
NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }}
test_tags:
- "bismark"
- "bismark_hisat"
- "bwameth"
profile:
- "docker"
steps:
# Skip if it's a pull_request to dev and NXF_VER is '22.10.1'
- name: Skip condition
id: condition
run: |
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
fi

steps:
- name: Check out pipeline code
if: steps.condition.outputs.skip != 'true'
uses: actions/checkout@v3

- name: Hash Github Workspace
if: steps.condition.outputs.skip != 'true'
id: hash_workspace
run: |
echo "digest=$(echo methylseq2_${{ github.workspace }} | md5sum | cut -c 1-25)" >> $GITHUB_OUTPUT
- name: Cache test data
if: steps.condition.outputs.skip != 'true'
id: cache-testdata
uses: actions/cache@v3
with:
path: test-datasets/
key: ${{ steps.hash_workspace.outputs.digest }}

- name: Check out test data
if: steps.cache-testdata.outputs.cache-hit != 'true' && steps.condition.outputs.skip != 'true'
uses: actions/checkout@v3
with:
repository: nf-core/test-datasets
ref: methylseq
path: test-datasets/

- name: Replace remote paths in samplesheets
if: steps.condition.outputs.skip != 'true'
run: |
for f in ./test-datasets/samplesheet/*csv; do
sed -i 's=https://github.com/nf-core/test-datasets/raw/methylseq/=./test-datasets/=g' $f
Expand All @@ -83,25 +84,27 @@ jobs:
done;
- name: Install Nextflow
if: steps.condition.outputs.skip != 'true'
uses: nf-core/setup-nextflow@v1
with:
version: "${{ matrix.NXF_VER }}"

- name: Install nf-test
if: steps.condition.outputs.skip != 'true'
run: |
wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER
sudo mv nf-test /usr/local/bin/
- name: Run nf-test
if: steps.condition.outputs.skip != 'true'
run: |
nf-test test tests/pipeline/${{ matrix.aligner }}/ --profile "test,${{ matrix.profile }}" --tap=test.tap
nf-test test --tag ${{ matrix.test_tags }} --profile "test,${{ matrix.profile }}" --junitxml=test.xml
# If the test fails, output the software_versions.yml using the 'batcat' utility
- name: Output log on failure
if: failure()
run: |
sudo apt install bat > /dev/null
batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/output/pipeline_info/software_versions.yml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: test.xml
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Updated template to nf-core/tools v2.9
- Updated nf-core modules for FastQC, samtools sort, samtools flagstat
- Removes problematic `-m` memory assignment for samtools sort [#81](https://github.com/nf-core/methylseq/issues/81)
- Use `fromSamplesheet` from nf-validation [#341](https://github.com/nf-core/methylseq/pull/341)

### Bug fixes & refactoring

Expand Down
8 changes: 7 additions & 1 deletion assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@
"sample": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Sample name must be provided and cannot contain spaces"
"errorMessage": "Sample name must be provided and cannot contain spaces",
"meta": ["id"]
},
"fastq_1": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.f(ast)?q\\.gz$",
"errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'"
},
"fastq_2": {
"errorMessage": "FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'",
"type": "string",
"format": "file-path",
"exists": true,
"anyOf": [
{
"type": "string",
Expand Down
32 changes: 0 additions & 32 deletions modules/local/samplesheet_check.nf

This file was deleted.

44 changes: 0 additions & 44 deletions subworkflows/local/input_check.nf

This file was deleted.

Loading

0 comments on commit 89b0aa4

Please sign in to comment.