updated yml #51
This file contains 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
name: Test nf-core Modules | |
on: | |
push: | |
branches: | |
- 'github_actions_mza' | |
workflow_dispatch: | |
inputs: | |
runners: | |
description: 'Runners to test on' | |
type: choice | |
options: | |
- 'ubuntu-latest' | |
- 'self-hosted' | |
default: 'self-hosted' | |
# Cancel if a newer run is started | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# renovate: datasource=github-releases depName=askimed/nf-test versioning=semver | |
NFT_VER: '0.9.2' | |
NXF_ANSI_LOG: false | |
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity | |
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity | |
# renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver | |
NXF_VER: '24.10.1' | |
jobs: | |
discover-modules: | |
name: Discover nf-core Modules with Tests | |
runs-on: ubuntu-latest | |
outputs: | |
module_list: ${{ steps.get-modules.outputs.module_list }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: List nf-core Modules with Tests | |
id: get-modules | |
run: | | |
modules=$(find modules/nf-core -type d -maxdepth 1 -mindepth 1 | while read module; do | |
if [ -d "$module/tests" ]; then | |
basename "$module" | |
fi | |
done | jq -R -s -c 'split("\n") | map(select(length > 0))') | |
if [ "$modules" == "[]" ]; then | |
echo "No modules with tests found!" | |
exit 1 | |
fi | |
echo "module_list=$modules" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Display discovered modules | |
run: | | |
echo "Discovered modules with tests:" | |
echo '${{ steps.get-modules.outputs.module_list }}' | jq . | |
shell: bash | |
nf-test: | |
needs: discover-modules | |
runs-on: ${{ github.event.inputs.runners || 'self-hosted' }} | |
name: '${{ matrix.profile }} | ${{ matrix.shard }}' | |
# TODO | |
# needs: get-number-of-shards | |
# if: ${{ fromJSON(needs.get-number-of-shards.outputs.shards) != fromJSON('["1", "0"]') }} | |
strategy: | |
fail-fast: false | |
matrix: | |
module: ${{ fromJson(needs.discover-modules.outputs.module_list) }} | |
# NOTE We could split these, but there's probably going to be more process tests than workflow tests, so we're just going to combine them all and bump up the shards for now | |
# NOTE The name of the test would be name: "${{ matrix.filter }} | ${{ matrix.profile }} | ${{ matrix.shard }}" | |
# filter: [process, workflow] | |
profile: [singularity] | |
shard: [1, 2] | |
env: | |
# FIXME Bumping them up to make the transition smooth, then we can throttle them back | |
TOTAL_SHARDS: 5 | |
SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} | |
SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} | |
steps: | |
# Clean workspace | |
- name: Clean Workspace | |
run: | | |
rm -rf $GITHUB_WORKSPACE/* | |
# Checkout Code | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: | |
- name: Run nf-test Action | |
uses: ./.github/actions/nf-test-action | |
with: | |
profile: ${{ matrix.profile }} | |
shard: ${{ matrix.shard }} | |
total_shards: ${{ env.TOTAL_SHARDS }} | |
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner | |
uses: ./.github/actions/self-hosted-cleanup |