diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 439bd09c..3dd86b38 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,11 @@ jobs: - "23.04.0" - "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 @@ -72,11 +102,11 @@ jobs: - name: Run nf-test run: | nf-test test \ - --profile=${{ matrix.profile }} \ - tests/pipeline/*.nf.test \ - --tap=test.tap - - - uses: pcolby/tap-summary@v1 + --profile="test,${{ matrix.profile }}" \ + ${{ matrix.test }} \ + --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