Skip to content

TestWorkflows

TestWorkflows #31

Workflow file for this run

name: TestWorkflows
on:
schedule:
- cron: '0 0 * * 1'
jobs:
list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'List repos'
id: set-matrix
run: echo "matrix=$(find workflows -mindepth 1 -maxdepth 1 -type d | jq -R -s -c 'split("\n")[:-1] | map(split("/")[-1])')" >> "${GITHUB_OUTPUT}"
skip:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'List repos'
id: set-matrix
run: |
matrix=$(jq -R -s -c '[split("\n")[] | select(.|length>0)]' .github/workflows/test_workflows_skip.txt)
echo "Number of repos: ${matrix}"
echo "matrix=$matrix" >> "${GITHUB_OUTPUT}"
test:
needs: [list, skip]
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
repo: ${{ fromJson(needs.list.outputs.matrix) }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setup python"
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
env/requirements.txt
- name: 'Install packages'
run: |
pip install -r env/requirements.txt
- name: 'Worfklow Lint'
run: |
planemo workflow_lint \
--fail_level error \
"workflows/${{ matrix.repo }}"
- name: 'Test worflow'
if: ${{ ! contains(fromJson(needs.skip.outputs.matrix), matrix.repo) }}
timeout-minutes: 60
run: |
planemo test \
--engine external_galaxy \
--galaxy_url https://galaxy-synbiocad.org \
--galaxy_user_key "${{ secrets.GG_SYNBIOCAD_TOKEN }}" \
"workflows/${{ matrix.repo }}/${{ matrix.repo }}.ga"