-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from seqeralabs/update_ci
Copy in CI from fetchngs
- Loading branch information
Showing
3 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
".": | ||
- ./.github/workflows/** | ||
- ./nf-test.config | ||
- ./nextflow.config | ||
tests: | ||
- ./assets/* | ||
- ./bin/* | ||
- ./conf/* | ||
- ./main.nf | ||
- ./nextflow_schema.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,92 @@ | ||
name: nf-aggregate CI | ||
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors | ||
name: nf-core CI | ||
on: | ||
pull_request: | ||
release: | ||
types: | ||
- published | ||
types: [published] | ||
merge_group: | ||
types: | ||
- checks_requested | ||
branches: | ||
- master | ||
- dev | ||
|
||
env: | ||
NXF_ANSI_LOG: false | ||
NFT_VER: "0.8.4" | ||
NFT_WORKDIR: "~" | ||
NFT_DIFF: "pdiff" | ||
NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2" | ||
TOWER_ACCESS_TOKEN: ${{ secrets.TOWER_ACCESS_TOKEN }} | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
name: Find tags to test | ||
name: Check for changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tags: ${{ steps.get_tags.outputs.result }} | ||
nf_test_files: ${{ steps.list.outputs.components }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Combine all tags.yml files | ||
id: get_username | ||
run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml | ||
- name: debug | ||
run: cat .github/tags.yml | ||
- name: Get tags using yq | ||
id: get_tags | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq -e '. | keys | tojson' .github/tags.yml | ||
fetch-depth: 0 | ||
|
||
- name: List nf-test files | ||
id: list | ||
uses: adamrtalbot/[email protected] | ||
with: | ||
head: ${{ github.sha }} | ||
base: origin/${{ github.base_ref }} | ||
include: .github/include.yaml | ||
|
||
nf-test: | ||
name: nf-test ${{ matrix.tags }} ${{ matrix.profile }} nf-${{ matrix.NXF_VER }} | ||
- name: print list of nf-test files | ||
run: | | ||
echo ${{ steps.list.outputs.components }} | ||
test: | ||
name: ${{ matrix.nf_test_files }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }} | ||
needs: [changes] | ||
if: needs.changes.outputs.tags != '[]' | ||
if: needs.changes.outputs.nf_test_files != '[]' | ||
runs-on: ubuntu-latest | ||
env: | ||
TOWER_ACCESS_TOKEN: ${{ secrets.TOWER_ACCESS_TOKEN }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
NXF_VER: | ||
- "23.10.0" | ||
- "latest-everything" | ||
tags: ${{ fromJson(needs.changes.outputs.tags) }} | ||
nf_test_files: ["${{ fromJson(needs.changes.outputs.nf_test_files) }}"] | ||
profile: | ||
- "docker" | ||
|
||
steps: | ||
- name: Check out pipeline code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nextflow | ||
uses: nf-core/setup-nextflow@v1 | ||
uses: nf-core/setup-nextflow@v2 | ||
with: | ||
version: "${{ matrix.NXF_VER }}" | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
architecture: "x64" | ||
|
||
- name: Install pdiff to see diff between nf-test snapshots | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pdiff | ||
- name: Cache nf-test installation | ||
id: cache-software | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/usr/local/bin/nf-test | ||
/home/runner/.nf-test/nf-test.jar | ||
key: ${{ runner.os }}-${{ env.NFTEST_VER }}-nftest | ||
key: ${{ runner.os }}-${{ env.NFT_VER }}-nftest | ||
|
||
- name: Install nf-test | ||
if: steps.cache-software.outputs.cache-hit != 'true' | ||
|
@@ -80,7 +96,12 @@ jobs: | |
- name: Run nf-test | ||
run: | | ||
nf-test test --tag ${{ matrix.tags }} --profile "test,${{ matrix.profile }}" --junitxml=test.xml --verbose | ||
nf-test test --verbose ${{ matrix.nf_test_files }} --profile "+${{ matrix.profile }}" --junitxml=test.xml --tap=test.tap | ||
- uses: pcolby/tap-summary@v1 | ||
with: | ||
path: >- | ||
test.tap | ||
- name: Output log on failure | ||
if: failure() | ||
|
@@ -96,11 +117,13 @@ jobs: | |
|
||
confirm-pass: | ||
runs-on: ubuntu-latest | ||
needs: [changes, nf-test] | ||
needs: | ||
- changes | ||
- test | ||
if: always() | ||
steps: | ||
- name: All tests ok | ||
if: ${{ success() || !contains(needs.*.result, 'failure') }} | ||
if: ${{ !contains(needs.*.result, 'failure') }} | ||
run: exit 0 | ||
- name: One or more tests failed | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
|
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