|
1 |
| -name: nf-core CI |
2 | 1 | # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
|
| 2 | +name: nf-core CI |
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches:
|
6 |
| - - dev |
| 6 | + - "dev" |
7 | 7 | pull_request:
|
| 8 | + branches: |
| 9 | + - "dev" |
| 10 | + - "master" |
8 | 11 | release:
|
9 |
| - types: [published] |
| 12 | + types: |
| 13 | + - "published" |
10 | 14 |
|
11 | 15 | env:
|
12 | 16 | NXF_ANSI_LOG: false
|
| 17 | + NFTEST_VER: "0.8.4" |
13 | 18 |
|
14 | 19 | concurrency:
|
15 |
| - group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" |
| 20 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
16 | 21 | cancel-in-progress: true
|
17 | 22 |
|
18 | 23 | jobs:
|
19 |
| - test: |
20 |
| - name: Run pipeline with test data (AMP and ARG workflows) |
21 |
| - # Only run on push if this is the nf-core dev branch (merged PRs) |
22 |
| - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/funcscan') }}" |
| 24 | + define_nxf_versions: |
| 25 | + name: Choose nextflow versions to test against depending on target branch |
23 | 26 | runs-on: ubuntu-latest
|
24 |
| - strategy: |
25 |
| - matrix: |
26 |
| - NXF_VER: |
27 |
| - - "23.04.0" |
28 |
| - - "latest-everything" |
29 |
| - parameters: |
30 |
| - - "--annotation_tool prodigal" |
31 |
| - - "--annotation_tool prokka" |
32 |
| - - "--annotation_tool bakta --annotation_bakta_db_downloadtype light" |
33 |
| - |
| 27 | + outputs: |
| 28 | + matrix: ${{ steps.nxf_versions.outputs.matrix }} |
34 | 29 | steps:
|
35 |
| - - name: Check out pipeline code |
36 |
| - uses: actions/checkout@v3 |
37 |
| - |
38 |
| - - name: Install Nextflow |
39 |
| - uses: nf-core/setup-nextflow@v1 |
40 |
| - with: |
41 |
| - version: "${{ matrix.NXF_VER }}" |
42 |
| - |
43 |
| - - name: Run pipeline with test data (AMP and ARG workflows) |
| 30 | + - id: nxf_versions |
44 | 31 | run: |
|
45 |
| - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }} |
| 32 | + if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then |
| 33 | + echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT |
| 34 | + else |
| 35 | + echo matrix='["latest-everything", "23.10.0"]' | tee -a $GITHUB_OUTPUT |
| 36 | + fi |
46 | 37 |
|
47 |
| - test_bgc: |
48 |
| - name: Run pipeline with test data (BGC workflow) |
49 |
| - # Only run on push if this is the nf-core dev branch (merged PRs) |
50 |
| - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/funcscan') }}" |
| 38 | + test: |
| 39 | + name: nf-test |
| 40 | + needs: define_nxf_versions |
51 | 41 | runs-on: ubuntu-latest
|
52 | 42 | strategy:
|
| 43 | + fail-fast: false |
53 | 44 | matrix:
|
54 |
| - NXF_VER: |
55 |
| - - "23.04.0" |
56 |
| - - "latest-everything" |
57 |
| - parameters: |
58 |
| - - "--annotation_tool prodigal" |
59 |
| - - "--annotation_tool prokka" |
60 |
| - - "--annotation_tool bakta --annotation_bakta_db_downloadtype light" |
| 45 | + NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }} |
| 46 | + tags: |
| 47 | + - "test" |
| 48 | + - "test_nothing" |
| 49 | + - "test_bakta" |
| 50 | + - "test_prokka" |
| 51 | + - "test_bgc_pyrodigal" |
| 52 | + - "test_bgc_bakta" |
| 53 | + - "test_bgc_prokka" |
| 54 | + - "test_taxonomy_pyrodigal" |
| 55 | + - "test_taxonomy_bakta" |
| 56 | + - "test_taxonomy_prokka" |
| 57 | + - "test_preannotated" |
| 58 | + - "test_preannotated_bgc" |
| 59 | + profile: |
| 60 | + - "docker" |
61 | 61 |
|
62 | 62 | steps:
|
63 | 63 | - name: Check out pipeline code
|
64 |
| - uses: actions/checkout@v2 |
| 64 | + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 |
| 65 | + |
| 66 | + - name: Check out test data |
| 67 | + uses: actions/checkout@v3 |
| 68 | + with: |
| 69 | + repository: nf-core/test-datasets |
| 70 | + ref: funcscan |
| 71 | + path: test-datasets/ |
| 72 | + fetch-depth: 1 |
65 | 73 |
|
66 | 74 | - name: Install Nextflow
|
67 | 75 | uses: nf-core/setup-nextflow@v1
|
68 | 76 | with:
|
69 | 77 | version: "${{ matrix.NXF_VER }}"
|
70 | 78 |
|
71 |
| - - name: Run pipeline with test data (BGC workflow) |
| 79 | + - name: Disk space cleanup |
| 80 | + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
| 81 | + |
| 82 | + - name: Install nf-test |
72 | 83 | run: |
|
73 |
| - nextflow run ${GITHUB_WORKSPACE} -profile test_bgc,docker --outdir ./results ${{ matrix.parameters }} --bgc_skip_deepbgc |
| 84 | + wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER |
| 85 | + sudo mv nf-test /usr/local/bin/ |
74 | 86 |
|
75 |
| - test_deeparg: |
76 |
| - name: Run pipeline with test data (DeepARG only workflow) |
77 |
| - # Only run on push if this is the nf-core dev branch (merged PRs) |
78 |
| - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/funcscan') }}" |
79 |
| - runs-on: ubuntu-latest |
80 |
| - strategy: |
81 |
| - matrix: |
82 |
| - NXF_VER: |
83 |
| - - "23.04.0" |
84 |
| - - "latest-everything" |
85 |
| - parameters: |
86 |
| - - "--annotation_tool bakta --annotation_bakta_db_downloadtype light" |
87 |
| - - "--annotation_tool pyrodigal" |
| 87 | + - name: Run nf-test |
| 88 | + run: | |
| 89 | + nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml |
88 | 90 |
|
89 |
| - steps: |
90 |
| - - name: Check out pipeline code |
91 |
| - uses: actions/checkout@v2 |
| 91 | + - name: Output log on failure |
| 92 | + if: failure() |
| 93 | + run: | |
| 94 | + sudo apt install bat > /dev/null |
| 95 | + batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/*/tests/output/pipeline_info/software_versions.yml |
92 | 96 |
|
93 |
| - - name: Install Nextflow |
94 |
| - uses: nf-core/setup-nextflow@v1 |
| 97 | + - name: Publish Test Report |
| 98 | + uses: mikepenz/action-junit-report@v3 |
| 99 | + if: always() # always run even if the previous step fails |
95 | 100 | with:
|
96 |
| - version: "${{ matrix.NXF_VER }}" |
97 |
| - |
98 |
| - - name: Run pipeline with test data (DeepARG workflow) |
99 |
| - run: | |
100 |
| - wget https://zenodo.org/record/8280582/files/deeparg.zip ## download from zenodo due to instability of deepARG server |
101 |
| - unzip deeparg.zip |
102 |
| - nextflow run ${GITHUB_WORKSPACE} -profile test_deeparg,docker --outdir ./results ${{ matrix.parameters }} --arg_deeparg_data 'deeparg/' |
| 101 | + report_paths: "*.xml" |
0 commit comments