Init channel-based reports #93
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #inspired by https://docs.cirro.bio/pipelines/development/#automated-testing | |
| name: Nextflow Tests | |
| on: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| env: | |
| DEFAULT_CONTAINER: ${{ vars.CONTAINER || 'ghcr.io/karchinlab/tcrtoolkit:main' }} | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - &resolve_test_container | |
| name: Resolve test container | |
| shell: bash | |
| env: | |
| IMAGE_BASE: ghcr.io/${{ github.repository }} | |
| SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| run: | | |
| container="$DEFAULT_CONTAINER" | |
| if [[ "$container" == 'ghcr.io/karchinlab/tcrtoolkit:main' ]]; then | |
| candidate="$IMAGE_BASE:${SOURCE_SHA::7}" | |
| if docker manifest inspect "$candidate" >/dev/null 2>&1; then | |
| container="$candidate" | |
| fi | |
| fi | |
| echo "CONTAINER=$container" >> "$GITHUB_ENV" | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Install Nextflow | |
| run: | | |
| wget -qO- get.nextflow.io | bash | |
| sudo mv nextflow /usr/local/bin/ | |
| - name: Install nf-test | |
| run: | | |
| wget -qO- https://get.nf-test.com | bash | |
| sudo mv nf-test /usr/local/bin | |
| - name: Run unit tests | |
| run: nf-test test tests/modules/ --verbose --junitxml=unit-test-results.xml | |
| - name: Publish unit test results | |
| if: always() | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| files: unit-test-results.xml | |
| check_name: Unit Test Results | |
| - name: Upload unit test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-test-results | |
| path: | | |
| .nf-test/tests/ | |
| unit-test-results.xml | |
| pipeline-test: | |
| name: Pipeline Integration Test | |
| runs-on: ubuntu-latest | |
| needs: unit-tests | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - *resolve_test_container | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Install Nextflow | |
| run: | | |
| wget -qO- get.nextflow.io | bash | |
| sudo mv nextflow /usr/local/bin/ | |
| - name: Install nf-test | |
| run: | | |
| wget -qO- https://get.nf-test.com | bash | |
| sudo mv nf-test /usr/local/bin | |
| - name: Run pipeline test | |
| run: nf-test test tests/main.nf.test --verbose --junitxml=pipeline-test-results.xml |