Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scatter ci #122

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 38 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,47 @@ 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:
NXF_VER:
- "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
Expand Down Expand Up @@ -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
20 changes: 20 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -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