Skip to content

Commit

Permalink
finding local modules too
Browse files Browse the repository at this point in the history
  • Loading branch information
anwarMZ committed Nov 27, 2024
1 parent cbb22a0 commit a113b75
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/actions/nf-test-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ runs:
TAGS: ${{ inputs.tags && format('--tag {0}', inputs.tags) || '' }}
NFT_WORKDIR: "~"
run: |
module_path="$GITHUB_WORKSPACE/modules/nf-core/${{ inputs.module }}"
module_path="$GITHUB_WORKSPACE/${{ inputs.module }}"
echo "Testing module: $module_path"
ls -R $module_path
Expand All @@ -87,7 +87,7 @@ runs:
- uses: pcolby/tap-summary@v1
if: always()
with:
path: ${{ github.workspace }}/modules/nf-core/${{ inputs.module }}/test.tap
path: ${{ github.workspace }}/${{ inputs.module }}/test.tap

- name: Clean up
if: always()
Expand Down
50 changes: 33 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
name: Test nf-core Modules and Sub-workflows

on:
push:
branches:
- 'github_actions_mza'
workflow_dispatch:
inputs:
runners:
description: 'Runners to test on'
type: choice
options:
- 'ubuntu-latest'
- 'self-hosted'
default: 'ubuntu-latest'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NFT_VER: '0.9.2'
NXF_ANSI_LOG: false
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
NXF_VER: '24.10.1'

jobs:
discover-modules:
name: Discover Modules with Tests
Expand All @@ -11,7 +39,7 @@ jobs:
- name: List Modules with Tests
id: get-modules
run: |
modules=$(find . -type d -path "*/modules/*" | while read module; do
modules=$(find modules -maxdepth 3 -mindepth 3 -type d | while read module; do
if [ -d "$module/tests" ]; then
echo "$module"
fi
Expand Down Expand Up @@ -60,22 +88,10 @@ jobs:
- name: Display Test Summary
if: always()
run: |
echo "Module path: ${{ matrix.module }}"
if [ -d "${{ matrix.module }}" ]; then
echo "Module directory exists"
if [ -f "${{ matrix.module }}/tests/main.nf.test" ]; then
echo "Test file exists: ${{ matrix.module }}/tests/main.nf.test"
if [ -f "${{ matrix.module }}/test.tap" ]; then
echo "Test Summary for ${{ matrix.module }} (${{ matrix.profile }}):"
cat ${{ matrix.module }}/test.tap | grep -E '^(not )?ok'
else
echo "No test.tap file found for ${{ matrix.module }}"
fi
else
echo "No test file found at ${{ matrix.module }}/tests/main.nf.test"
fi
if [ -f "${{ matrix.module }}/test.tap" ]; then
echo "Test Summary for ${{ matrix.module }} (${{ matrix.profile }}):"
cat ${{ matrix.module }}/test.tap | grep -E '^(not )?ok'
else
echo "Module directory does not exist: ${{ matrix.module }}"
ls -R $GITHUB_WORKSPACE/modules
echo "No test.tap file found for ${{ matrix.module }}"
fi
shell: bash

0 comments on commit a113b75

Please sign in to comment.