From 8e79d5ca70e26b5bdf524a9d33515488a0c7e2ce Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Wed, 4 Oct 2023 20:50:14 -0500 Subject: [PATCH 1/4] ci: Write initial scatter CI --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 439bd09c..f2014d42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,35 @@ concurrency: cancel-in-progress: true jobs: + list: + name: List Tests + if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/nascent') }}" + outputs: + # Expose matched filters as job 'modules' output variable + tests: ${{ steps.list.outputs.tests }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Nextflow + uses: nf-core/setup-nextflow@v1 + + - name: Install nf-test + if: steps.cache-software.outputs.cache-hit != 'true' + run: | + wget -qO- https://code.askimed.com/install/nf-test | bash + sudo mv nf-test /usr/local/bin/ + + - name: List nf-test + id: list + run: | + echo "tests=$(nf-test list --silent --format=json)" >> "$GITHUB_OUTPUT" + test: name: nf-test ${{ matrix.profile }}-${{ matrix.NXF_VER }} # 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/nascent') }}" + if: needs.list.outputs.tests != '[]' + needs: [list] runs-on: ubuntu-latest strategy: matrix: @@ -27,6 +52,7 @@ jobs: - "23.04.0" - "latest-everything" profile: ["docker"] # TODO , "singularity", "conda"] + test: ["${{ fromJson(needs.list.outputs.tests) }}"] steps: - name: Check out pipeline code uses: actions/checkout@v3 @@ -73,7 +99,7 @@ jobs: run: | nf-test test \ --profile=${{ matrix.profile }} \ - tests/pipeline/*.nf.test \ + ${{ matrix.test }} \ --tap=test.tap - uses: pcolby/tap-summary@v1 From b696e773f342dd0e4f11a987ecb2ce48727962e4 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Wed, 4 Oct 2023 22:36:50 -0500 Subject: [PATCH 2/4] ci: Add test report workflow --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/test-report.yml | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2014d42..e468b362 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,9 +100,9 @@ jobs: nf-test test \ --profile=${{ matrix.profile }} \ ${{ matrix.test }} \ - --tap=test.tap - - - uses: pcolby/tap-summary@v1 + --junitxml=${{ matrix.test }}-${{ matrix.profile }}.xml + - uses: actions/upload-artifact@v3 # upload test results + if: success() || failure() # run this step even if previous step failed with: - path: >- - test.tap + name: test-results + path: ${{ matrix.test }}-${{ matrix.profile }}.xml diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 00000000..cee35a59 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,20 @@ +name: "Test Report" +on: + workflow_run: + workflows: ["nf-core CI"] # runs after CI workflow + types: + - completed +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results # artifact name + name: JEST Tests # Name of the check run which will be created + path: "*.xml" # Path to test results (inside artifact .zip) + reporter: jest-junit # Format of test results From dcfbf52eb971bb5312992ce1b82cf8648cc6d901 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Wed, 4 Oct 2023 22:48:41 -0500 Subject: [PATCH 3/4] ci: Add test profile --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e468b362..885509c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,7 @@ jobs: - name: Run nf-test run: | nf-test test \ - --profile=${{ matrix.profile }} \ + --profile="test,${{ matrix.profile }}" \ ${{ matrix.test }} \ --junitxml=${{ matrix.test }}-${{ matrix.profile }}.xml - uses: actions/upload-artifact@v3 # upload test results From 7532677565d2f4f03ddf5796029cc1d3ae4953e4 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Wed, 4 Oct 2023 23:03:10 -0500 Subject: [PATCH 4/4] ci: Ignore grohmm tests --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 885509c0..3dd86b38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,10 @@ jobs: - "latest-everything" profile: ["docker"] # TODO , "singularity", "conda"] test: ["${{ fromJson(needs.list.outputs.tests) }}"] + exclude: + - test: "tests/subworkflows/local/grohmm/main.nf.test@3508b8c9" + - test: "tests/subworkflows/local/grohmm/main.nf.test@716555be" + - test: "tests/subworkflows/local/grohmm/main.nf.test@306b4b15" steps: - name: Check out pipeline code uses: actions/checkout@v3