Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IUC workflows reusable #4830

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
025e57b
make workflows reusable
bernt-matthias Sep 29, 2022
ed276d1
test bumps
bernt-matthias Sep 29, 2022
f7697a5
bump tool failing testing
bernt-matthias Oct 1, 2022
1fe2c4b
Add linting report and error-level
bernt-matthias Oct 1, 2022
984caee
rename workflow files and do not set defaults
bernt-matthias Oct 1, 2022
ac2059a
add autoupdate
bernt-matthias Oct 1, 2022
a7ebdec
update all used actions
bernt-matthias Oct 4, 2022
736839c
cleanup wf
bernt-matthias Oct 4, 2022
065540e
cleanup autoupdate
bernt-matthias Oct 4, 2022
022d11f
move deploy check for forked repos
bernt-matthias Oct 4, 2022
426e1d0
fix fail level
bernt-matthias Oct 4, 2022
990d861
also don't run PR workflow on forks
bernt-matthias Oct 5, 2022
42c3ea5
cont
bernt-matthias Oct 6, 2022
4cac4ae
remove autoupdate
bernt-matthias Oct 6, 2022
d693232
add planemo-version to the slash command parameters
bernt-matthias Oct 6, 2022
4de59d7
incorporate latest changes
bernt-matthias Nov 17, 2022
0a15fb8
Add cleaning of dotnet folder
bernt-matthias Nov 27, 2022
20cec22
Merge branch 'master' into topic/reusable-workflows
bernt-matthias Nov 27, 2022
81e2b8b
TMP adjust to test in fork
bernt-matthias Nov 27, 2022
1eafcce
finish planemo-version
bernt-matthias Nov 27, 2022
48af3db
planemo version cbt
bernt-matthias Nov 27, 2022
bb0dc25
restore vars step
bernt-matthias Dec 8, 2022
b247248
add planemo-version to output
bernt-matthias Dec 8, 2022
888c789
Revert "TMP adjust to test in fork"
bernt-matthias Dec 18, 2022
c21ad94
make flake8 plugins configurable
bernt-matthias Dec 18, 2022
2735e37
only run slash workflow if PAT is defined
bernt-matthias Dec 18, 2022
d99b6f4
add deploy report job
bernt-matthias Jan 21, 2023
3a19c7b
Revert "test bumps"
bernt-matthias Jan 27, 2023
69852eb
Revert "bump tool failing testing"
bernt-matthias Jan 27, 2023
50f4e24
Merge branch 'main' into topic/reusable-workflows
bernt-matthias Jan 27, 2023
ef6e04a
fix merge mistake
bernt-matthias Jan 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8_requirements
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flake8
flake8-import-order
200 changes: 20 additions & 180 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,191 +5,31 @@ on:
- cron: '0 0 * * 1'
repository_dispatch:
types: [run-all-tool-tests-command]
env:
GALAXY_FORK: galaxyproject
GALAXY_BRANCH: release_22.05
MAX_CHUNKS: 40
jobs:
setup:
name: Setup cache and determine changed repositories
# adapt the owner name
if: ${{ github.repository_owner == 'galaxyproject' }}
runs-on: ubuntu-latest
outputs:
galaxy-head-sha: ${{ steps.get-galaxy-sha.outputs.galaxy-head-sha }}
fork: ${{ steps.get-fork-branch.outputs.fork }}
branch: ${{ steps.get-fork-branch.outputs.branch }}
repository-list: ${{ steps.discover.outputs.repository-list }}
chunk-count: ${{ steps.discover.outputs.chunk-count }}
chunk-list: ${{ steps.discover.outputs.chunk-list }}
strategy:
matrix:
python-version: ['3.7']
steps:
- name: Add reaction
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reaction-type: hooray
- name: Set galaxy fork and branch
id: get-fork-branch
run: |
TMP="${{ github.event.client_payload.slash_command.args.named.fork }}"
echo "fork=${TMP:-$GALAXY_FORK}" >> $GITHUB_OUTPUT
TMP="${{ github.event.client_payload.slash_command.args.named.branch }}"
echo "branch=${TMP:-$GALAXY_BRANCH}" >> $GITHUB_OUTPUT
- name: Determine latest commit in the Galaxy repo
id: get-galaxy-sha
run: echo "galaxy-head-sha=$(git ls-remote https://github.com/${{ steps.get-fork-branch.outputs.fork }}/galaxy refs/heads/${{ steps.get-fork-branch.outputs.branch }} | cut -f1)" >> $GITHUB_OUTPUT
- 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_${{ steps.get-galaxy-sha.outputs.galaxy-head-sha }}
# Install the `wheel` package so that when installing other packages which
# are not available as wheels, pip will build a wheel for them, which can be cached.
- name: Install wheel
run: pip install wheel
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks
uses: galaxyproject/planemo-ci-action@v1
id: discover
with:
create-cache: ${{ steps.cache-pip.outputs.cache-hit != 'true' || steps.cache-planemo.outputs.cache-hit != 'true' }}
galaxy-fork: ${{ steps.get-fork-branch.outputs.fork }}
galaxy-branch: ${{ steps.get-fork-branch.outputs.branch }}
max-chunks: ${{ env.MAX_CHUNKS }}
python-version: ${{ matrix.python-version }}
- name: Show repository list
run: echo '${{ steps.discover.outputs.repository-list }}'
- name: Show chunks
run: |
echo 'Using ${{ steps.discover.outputs.chunk-count }} chunks (${{ steps.discover.outputs.chunk-list }})'
uses: galaxyproject/tools-iuc/.github/workflows/wf_setup.yaml@master
with:
# default-galaxy-fork: galaxyproject
# default-galaxy-branch: release_22.05
max-chunks: 40
secrets:
PAT: ${{ secrets.PAT }}

test:
name: Test tools
# This job runs on Linux
runs-on: ubuntu-latest
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' }}
strategy:
fail-fast: false
matrix:
chunk: ${{ fromJson(needs.setup.outputs.chunk-list) }}
python-version: ['3.7']
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
steps:
# checkout the repository
# and use it as the current working directory
- 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: 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
with:
mode: test
repository-list: ${{ needs.setup.outputs.repository-list }}
galaxy-fork: ${{ needs.setup.outputs.fork }}
galaxy-branch: ${{ needs.setup.outputs.branch }}
chunk: ${{ matrix.chunk }}
chunk-count: ${{ needs.setup.outputs.chunk-count }}
galaxy-slots: ${{ steps.cpu-cores.outputs.count }}
# Limit each test to 15 minutes
test_timeout: 900
- uses: actions/upload-artifact@v3
with:
name: 'Tool test output ${{ matrix.chunk }}'
path: upload

# - combine the results of the test chunks (which will never fail due
# to `|| true`) and create a global test report as json and html which
# is provided as artifact
# - check if any tool test actually failed (by lookup in the combined json)
# and fail this step if this is the case
combine_outputs:
name: Combine chunked test results
needs: [setup, test]
strategy:
matrix:
python-version: ['3.7']
# This job runs on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
path: artifacts
- 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: Combine outputs
uses: galaxyproject/planemo-ci-action@v1
id: combine
with:
mode: combine
html-report: true
- uses: actions/upload-artifact@v3
with:
name: 'All tool test results'
path: upload
- name: Create URL to the run output
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT

- name: Create comment
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
body: |
Summary:

${{ steps.combine.outputs.statistics }}

[Find all tool test results here][1]

[1]: ${{ steps.vars.outputs.run-url }}
- name: Check outputs
uses: galaxyproject/planemo-ci-action@v1
id: check
with:
mode: check
uses: galaxyproject/tools-iuc/.github/workflows/wf_test.yaml@master
with:
galaxy-fork: ${{ needs.setup.outputs.galaxy-fork }}
galaxy-branch: ${{ needs.setup.outputs.galaxy-branch }}
planemo-version: ${{ needs.setup.outputs.planemo-version }}
repository-list: ${{ needs.setup.outputs.repository-list }}
chunk-count: ${{ needs.setup.outputs.chunk-count }}
chunk-list: ${{ needs.setup.outputs.chunk-list }}
galaxy-head-sha: ${{ needs.setup.outputs.galaxy-head-sha }}
# test-timeout: 900
secrets:
PAT: ${{ secrets.PAT }}
Loading