Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening committed Feb 10, 2024
1 parent c33dc60 commit ff12eda
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 15 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [run-all-tool-tests-command]
env:
GALAXY_FORK: galaxyproject
GALAXY_BRANCH: release_23.0
GALAXY_BRANCH: release_23.2
MAX_CHUNKS: 40
jobs:
setup:
Expand All @@ -23,7 +23,7 @@ jobs:
chunk-list: ${{ steps.discover.outputs.chunk-list }}
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- name: Add reaction
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
Expand Down Expand Up @@ -74,6 +74,42 @@ jobs:
run: |
echo 'Using ${{ steps.discover.outputs.chunk-count }} chunks (${{ steps.discover.outputs.chunk-list }})'
lint:
name: Check for missing containers
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Planemo lint
uses: galaxyproject/planemo-ci-action@v1
id: lint
with:
mode: lint
repository-list: ${{ needs.setup.outputs.repository-list }}
tool-list: ${{ needs.setup.outputs.tool-list }}
additional-planemo-options: --biocontainers -s tests,output,inputs,help,general,command,citations,tool_xsd,xml_order,tool_urls,shed_metadata
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: 'Tool linting output'
path: lint_report.txt

test:
name: Test tools
# This job runs on Linux
Expand All @@ -84,7 +120,7 @@ jobs:
fail-fast: false
matrix:
chunk: ${{ fromJson(needs.setup.outputs.chunk-list) }}
python-version: ['3.7']
python-version: ['3.11']
services:
postgres:
image: postgres:11
Expand Down Expand Up @@ -142,7 +178,7 @@ jobs:
needs: [setup, test]
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
# This job runs on Linux
runs-on: ubuntu-latest
steps:
Expand Down
73 changes: 62 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
name: Galaxy Tool Linting and Tests for push and PR
on:
pull_request:
paths-ignore:
- '.github/**'
- 'deprecated/**'
- 'docs/**'
- '*'
push:
branches:
- main
- master
paths-ignore:
- '.github/**'
- 'deprecated/**'
- 'docs/**'
- '*'
env:
GALAXY_FORK: galaxyproject
GALAXY_BRANCH: release_23.0
GALAXY_BRANCH: release_23.2
MAX_CHUNKS: 4
MAX_FILE_SIZE: 1M
concurrency:
Expand Down Expand Up @@ -35,7 +45,7 @@ jobs:
commit-range: ${{ steps.discover.outputs.commit-range }}
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- name: Print github context properties
run: |
Expand Down Expand Up @@ -101,7 +111,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -115,11 +125,21 @@ jobs:
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}

- name: Set fail level for pull request
if: ${{ github.event_name == 'pull_request' }}
run:
echo "FAIL_LEVEL=warn" >> "$GITHUB_ENV"
- name: Set fail level for merge
if: ${{ github.event_name != 'pull_request' }}
run:
echo "FAIL_LEVEL=error" >> "$GITHUB_ENV"
- name: Planemo lint
uses: galaxyproject/planemo-ci-action@v1
id: lint
with:
mode: lint
fail-level: ${{ env.FAIL_LEVEL }}
repository-list: ${{ needs.setup.outputs.repository-list }}
tool-list: ${{ needs.setup.outputs.tool-list }}
- uses: actions/upload-artifact@v3
Expand All @@ -132,12 +152,12 @@ jobs:
flake8:
name: Lint Python scripts
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' }}
if: ${{ github.event_name == 'pull_request' && needs.setup.outputs.repository-list != '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -164,7 +184,7 @@ jobs:
lintr:
name: Lint R scripts
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' }}
if: ${{ github.event_name == 'pull_request' && needs.setup.outputs.repository-list != '' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -258,7 +278,7 @@ jobs:
fail-fast: false
matrix:
chunk: ${{ fromJson(needs.setup.outputs.chunk-list) }}
python-version: ['3.7']
python-version: ['3.11']
services:
postgres:
image: postgres:11
Expand Down Expand Up @@ -290,6 +310,8 @@ jobs:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Clean dotnet folder for space
run: rm -Rf /usr/share/dotnet
- name: Planemo test
uses: galaxyproject/planemo-ci-action@v1
id: test
Expand All @@ -316,11 +338,11 @@ jobs:
combine_outputs:
name: Combine chunked test results
needs: [setup, test]
if: ${{ needs.setup.outputs.repository-list != '' }}
if: ${{ always() && needs.setup.outputs.repository-list != '' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- uses: actions/download-artifact@v3
with:
Expand All @@ -340,6 +362,7 @@ jobs:
with:
mode: combine
html-report: true
markdown-report: true
- uses: actions/upload-artifact@v3
with:
name: 'All tool test results'
Expand All @@ -349,16 +372,44 @@ jobs:
id: check
with:
mode: check
- name: Check if all test chunks succeeded
run: |
NFILES=$(ls artifacts/ | grep "Tool test output" | wc -l)
if [[ "${{ needs.setup.outputs.chunk-count }}" != "$NFILES" ]]; then
exit 1
fi
- run: cat upload/tool_test_output.md >> $GITHUB_STEP_SUMMARY
# the following only works for PRs opened from the main fork
# which we should not do (but lets leave this here until we have a
# solution)
- name: Get PR object
if: failure()
uses: 8BitJonny/[email protected]
id: failed_pr_number
with:
sha: ${{ github.event.pull_request.head.sha }}
- name: Debug GetPR output
if: failure()
run: |
echo ${{ steps.failed_pr_number.outputs.number }}
- name: Post comment with test report
if: failure()
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.failed_pr_number.outputs.number }}
body-path: upload/tool_test_output.md


# deploy the tools to the toolsheds (first TTS for testing)
deploy:
name: Deploy
needs: [setup, lint, flake8, lintr, combine_outputs]
needs: [setup, lint, combine_outputs]
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) && github.repository_owner == 'bgruening' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit ff12eda

Please sign in to comment.