TestTools #11
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: TestTools | |
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@v3 | |
- name: 'List repos' | |
id: set-matrix | |
run: echo "matrix=$(find tools -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@v3 | |
- name: 'List repos' | |
id: set-matrix | |
run: | | |
matrix=$(jq -R -s -c '[split("\n")[] | select(.|length>0)]' .github/workflows/test_tools_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@v3 | |
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: 'Prepare output' | |
run: | | |
mkdir -p "log/${{ matrix.repo }}" | |
- name: 'Wrapper Lint' | |
run: | | |
planemo lint "tools/${{ matrix.repo }}" | |
- name: 'Shed lint' | |
run: | | |
planemo shed_lint --urls --xsd --ensure_metadata "tools/${{ matrix.repo }}" | |
./scripts/shed_lint.py -i "tools/${{ matrix.repo }}" | |
- name: 'Prepare' | |
run: | | |
mkdir -p "log/${{ matrix.repo }}" | |
- name: 'Test tool' | |
if: ${{ ! contains(fromJson(needs.skip.outputs.matrix), matrix.repo) }} | |
timeout-minutes: 120 | |
continue-on-error: true | |
run: | | |
planemo test \ | |
--biocontainers \ | |
--no_dependency_resolution \ | |
--no_conda_auto_init \ | |
--galaxy_source https://github.com/galaxyproject/galaxy \ | |
--galaxy_branch release_22.05 \ | |
--galaxy_python_version 3.7 \ | |
"tools/${{ matrix.repo }}" | |
mv tool_test_output.json "log/${{ matrix.repo }}" | |
- name: 'Prepare artefact' | |
run: | | |
zip -r -9 log.zip log | |
- name: 'Upload Artifact Version' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: log-artifact-${{ matrix.repo }} | |
path: log.zip | |
- name: 'Aggregate results' | |
if: ${{ ! contains(fromJson(needs.skip.outputs.matrix), matrix.repo) }} | |
run: | | |
./scripts/aggregate_test.py -i . |