-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
102 additions
and
15 deletions.
There are no files selected for viewing
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
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
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: | ||
|
@@ -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: | | ||
|
@@ -101,7 +111,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7'] | ||
python-version: ['3.11'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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' | ||
|
@@ -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: | ||
|