|
| 1 | +name: Stub pipeline test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - dev_ru |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +jobs: |
| 14 | + stub_viroprofiler: |
| 15 | + name: Stub test - VIROPROFILER workflow |
| 16 | + runs-on: ubuntu-latest |
| 17 | + timeout-minutes: 30 |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Check out repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Install Nextflow |
| 24 | + uses: nf-core/setup-nextflow@v2 |
| 25 | + with: |
| 26 | + version: ">=23.04.0" |
| 27 | + |
| 28 | + - name: Resolve samplesheet paths |
| 29 | + run: | |
| 30 | + export STUB_R1_PATH="${{ github.workspace }}/tests/data/stub_R1.fastq.gz" |
| 31 | + export STUB_R2_PATH="${{ github.workspace }}/tests/data/stub_R2.fastq.gz" |
| 32 | + envsubst '$STUB_R1_PATH $STUB_R2_PATH' < tests/data/samplesheet_stub.csv > /tmp/samplesheet_stub.csv |
| 33 | +
|
| 34 | + - name: Run stub test |
| 35 | + run: | |
| 36 | + nextflow run main.nf \ |
| 37 | + -stub \ |
| 38 | + -profile test_stub \ |
| 39 | + --input /tmp/samplesheet_stub.csv \ |
| 40 | + --outdir output_stub \ |
| 41 | + -with-trace \ |
| 42 | + 2>&1 | tee nextflow_stub.log |
| 43 | +
|
| 44 | + - name: Verify success |
| 45 | + run: | |
| 46 | + if grep -q "ERROR ~" nextflow_stub.log; then |
| 47 | + echo "=== Errors found ===" |
| 48 | + grep "ERROR ~" nextflow_stub.log |
| 49 | + exit 1 |
| 50 | + fi |
| 51 | + grep -q "Succeeded\|Pipeline completed successfully" nextflow_stub.log || \ |
| 52 | + { echo "Pipeline did not report success"; tail -20 nextflow_stub.log; exit 1; } |
| 53 | +
|
| 54 | + - name: Upload logs on failure |
| 55 | + if: failure() |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: stub-viroprofiler-logs |
| 59 | + path: | |
| 60 | + nextflow_stub.log |
| 61 | + .nextflow.log |
| 62 | + output_stub/pipeline_info/ |
| 63 | +
|
| 64 | + stub_contiganno: |
| 65 | + name: Stub test - CONTIGANNO workflow |
| 66 | + runs-on: ubuntu-latest |
| 67 | + timeout-minutes: 30 |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Check out repository |
| 71 | + uses: actions/checkout@v4 |
| 72 | + |
| 73 | + - name: Install Nextflow |
| 74 | + uses: nf-core/setup-nextflow@v2 |
| 75 | + with: |
| 76 | + version: ">=23.04.0" |
| 77 | + |
| 78 | + - name: Run stub test |
| 79 | + run: | |
| 80 | + nextflow run main.nf \ |
| 81 | + -stub \ |
| 82 | + -profile test_stub \ |
| 83 | + --input_contigs "${{ github.workspace }}/tests/data/stub_contigs.fasta" \ |
| 84 | + --outdir output_stub_contiganno \ |
| 85 | + 2>&1 | tee nextflow_stub_contiganno.log |
| 86 | +
|
| 87 | + - name: Verify success |
| 88 | + run: | |
| 89 | + if grep -q "ERROR ~" nextflow_stub_contiganno.log; then |
| 90 | + echo "=== Errors found ===" |
| 91 | + grep "ERROR ~" nextflow_stub_contiganno.log |
| 92 | + exit 1 |
| 93 | + fi |
| 94 | + grep -q "Succeeded\|Pipeline completed successfully" nextflow_stub_contiganno.log || \ |
| 95 | + { echo "Pipeline did not report success"; tail -20 nextflow_stub_contiganno.log; exit 1; } |
| 96 | +
|
| 97 | + - name: Upload logs on failure |
| 98 | + if: failure() |
| 99 | + uses: actions/upload-artifact@v4 |
| 100 | + with: |
| 101 | + name: stub-contiganno-logs |
| 102 | + path: | |
| 103 | + nextflow_stub_contiganno.log |
| 104 | + .nextflow.log |
| 105 | + output_stub_contiganno/pipeline_info/ |
0 commit comments