From 0c69a1c392d425b93b059065ac4a648dd3c9b9b2 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 6 Sep 2021 18:10:01 +0200 Subject: [PATCH 01/32] update test data for PRs as slash command and trigger run-all-tool-test only from issues --- .github/workflows/pr.yaml | 44 +++++++++++++++++++++++++++++++++++- .github/workflows/slash.yaml | 14 ++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d44cd5fa4fe..c5d756b7ec2 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,5 +1,9 @@ name: Galaxy Tool Linting and Tests for push and PR -on: [push, pull_request] +on: + push + pull_request + repository_dispatch: + types: [update-test-data-command] env: GALAXY_FORK: galaxyproject GALAXY_BRANCH: release_21.05 @@ -21,10 +25,27 @@ jobs: tool-list: ${{ steps.discover.outputs.tool-list }} chunk-count: ${{ steps.discover.outputs.chunk-count }} chunk-list: ${{ steps.discover.outputs.chunk-list }} + output-test-data: ${{ steps.output-test-data.outputs.output-test-data }} 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@v1 + 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 update-test-data for slash commands + id: update-test-data + run: | + if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then + echo "::set-output name=update-test-data::true" + else + echo "::set-output name=update-test-data::false" + fi - name: Print github context properties run: | echo 'event: ${{ github.event_name }}' @@ -70,6 +91,7 @@ jobs: galaxy-branch: ${{ env.GALAXY_BRANCH }} max-chunks: ${{ env.MAX_CHUNKS }} python-version: ${{ matrix.python-version }} + update-test-data: ${{ steps.update-test-data.outputs.update-test-data }} - name: Show commit range run: echo '${{ steps.discover.outputs.commit-range }}' - name: Show repository list @@ -262,6 +284,7 @@ jobs: galaxy-branch: ${{ env.GALAXY_BRANCH }} chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup.outputs.chunk-count }} + update-test-data: ${{ needs.setup.outputs.update-test-date }} - uses: actions/upload-artifact@v2 with: name: 'Tool test output ${{ matrix.chunk }}' @@ -353,6 +376,25 @@ jobs: if: ${{ always() && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest steps: + - name: Create URL to the run output + if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} + id: vars + run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + - name: Create comment + if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} + uses: peter-evans/create-or-update-comment@v1 + 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 tool lint status if: ${{ needs.lint.result != 'success' && needs.flake8.result != 'skipped' }} run: exit 1 diff --git a/.github/workflows/slash.yaml b/.github/workflows/slash.yaml index 664d53916cd..6e8cec9b131 100644 --- a/.github/workflows/slash.yaml +++ b/.github/workflows/slash.yaml @@ -11,5 +11,15 @@ jobs: uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.PAT }} - commands: | - run-all-tool-tests + config: > + [ + { + "command": "run-all-tool-tests", + "issue_type": "issue" + } + { + "command": "update-test-data", + "permission": "write", + "issue_type": "pull-request" + } + ] From 00b1b8daa424eda190ce9c9ba46c668e95644b95 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 7 Sep 2021 16:22:06 +0200 Subject: [PATCH 02/32] try to push --- .github/workflows/pr.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c5d756b7ec2..8e781d432ec 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -285,6 +285,15 @@ jobs: chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup.outputs.chunk-count }} update-test-data: ${{ needs.setup.outputs.update-test-date }} + - name: Push updated test data + if: ${{ needs.setup.outputs.update-test-date }} + uses: actions/checkout@v2 + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "update test data" + git push - uses: actions/upload-artifact@v2 with: name: 'Tool test output ${{ matrix.chunk }}' From a6068a0a3be9950109228760b4ad8f0340f5cac9 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:04:29 +0200 Subject: [PATCH 03/32] slash for bernt-matthias --- .github/workflows/slash.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slash.yaml b/.github/workflows/slash.yaml index 6e8cec9b131..fd18e1da049 100644 --- a/.github/workflows/slash.yaml +++ b/.github/workflows/slash.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Slash Command Dispatch - if: github.repository_owner == 'galaxyproject' + if: github.repository_owner == 'bernt-matthias' uses: peter-evans/slash-command-dispatch@v2 with: token: ${{ secrets.PAT }} From e1d9040677586987f1101e460b2c5aa2140a2a6d Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:05:36 +0200 Subject: [PATCH 04/32] missing comma --- .github/workflows/slash.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slash.yaml b/.github/workflows/slash.yaml index fd18e1da049..3fd8d83b086 100644 --- a/.github/workflows/slash.yaml +++ b/.github/workflows/slash.yaml @@ -16,7 +16,7 @@ jobs: { "command": "run-all-tool-tests", "issue_type": "issue" - } + }, { "command": "update-test-data", "permission": "write", From e5c24fe53ea52cc4f309a28013c9702f2ead0347 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:07:52 +0200 Subject: [PATCH 05/32] PR fix on syntax --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8e781d432ec..fdb23c6bfd5 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,7 +1,7 @@ name: Galaxy Tool Linting and Tests for push and PR on: - push - pull_request + push: + pull_request: repository_dispatch: types: [update-test-data-command] env: From 5413b6f163289b6851961e47a9f6a6b9d41cf076 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:09:50 +0200 Subject: [PATCH 06/32] PR fix commit --- .github/workflows/pr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index fdb23c6bfd5..bec447fa3a6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -287,7 +287,6 @@ jobs: update-test-data: ${{ needs.setup.outputs.update-test-date }} - name: Push updated test data if: ${{ needs.setup.outputs.update-test-date }} - uses: actions/checkout@v2 run: | git config user.name github-actions git config user.email github-actions@github.com From 046999e079e492dd98737720916bb7356193e664 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:11:33 +0200 Subject: [PATCH 07/32] PR: temp disable for push and PR --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bec447fa3a6..458f0fc43ac 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,7 +1,7 @@ name: Galaxy Tool Linting and Tests for push and PR on: - push: - pull_request: + # push: + # pull_request: repository_dispatch: types: [update-test-data-command] env: From 49b72016428aa35cff6a263e65614fe59e134782 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:30:49 +0200 Subject: [PATCH 08/32] debug --- .github/workflows/pr.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 458f0fc43ac..41ebef1e418 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -31,7 +31,7 @@ jobs: python-version: ['3.7'] steps: - name: Add reaction - if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} + if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} uses: peter-evans/create-or-update-comment@v1 with: token: ${{ secrets.PAT }} @@ -55,6 +55,7 @@ jobs: echo 'base_ref: ${{ github.base_ref }}' echo 'event.before: ${{ github.event.before }}' echo 'event.after: ${{ github.event.after }}' + echo 'github.event...: ${{ github.event.client_payload.pull_request }}' - name: Determine latest commit in the Galaxy repo id: get-galaxy-sha run: echo "::set-output name=galaxy-head-sha::$(git ls-remote https://github.com/${{ env.GALAXY_FORK }}/galaxy refs/heads/${{ env.GALAXY_BRANCH }} | cut -f1)" From 6875b6ffaadf3c24b3f0f479e83a365eb0f00228 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:32:38 +0200 Subject: [PATCH 09/32] debug --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 41ebef1e418..0efed07af8d 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -55,7 +55,7 @@ jobs: echo 'base_ref: ${{ github.base_ref }}' echo 'event.before: ${{ github.event.before }}' echo 'event.after: ${{ github.event.after }}' - echo 'github.event...: ${{ github.event.client_payload.pull_request }}' + echo 'github.event...: ${{ toJson(github.event.client_payload) }}' - name: Determine latest commit in the Galaxy repo id: get-galaxy-sha run: echo "::set-output name=galaxy-head-sha::$(git ls-remote https://github.com/${{ env.GALAXY_FORK }}/galaxy refs/heads/${{ env.GALAXY_BRANCH }} | cut -f1)" From db0207a68c5c5769fe52dbc341f3e7393a6b5a16 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:34:23 +0200 Subject: [PATCH 10/32] debug --- .github/workflows/pr.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0efed07af8d..3a60dca270c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -56,6 +56,10 @@ jobs: echo 'event.before: ${{ github.event.before }}' echo 'event.after: ${{ github.event.after }}' echo 'github.event...: ${{ toJson(github.event.client_payload) }}' + - name: Dump the client payload context + env: + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }} + run: echo "$PAYLOAD_CONTEXT" - name: Determine latest commit in the Galaxy repo id: get-galaxy-sha run: echo "::set-output name=galaxy-head-sha::$(git ls-remote https://github.com/${{ env.GALAXY_FORK }}/galaxy refs/heads/${{ env.GALAXY_BRANCH }} | cut -f1)" From fc16bc766134fccca0b6d7ee06c841e86fdbcecf Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 09:48:22 +0200 Subject: [PATCH 11/32] debug --- .github/workflows/pr.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 3a60dca270c..3ed2a0a4e55 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -55,10 +55,9 @@ jobs: echo 'base_ref: ${{ github.base_ref }}' echo 'event.before: ${{ github.event.before }}' echo 'event.after: ${{ github.event.after }}' - echo 'github.event...: ${{ toJson(github.event.client_payload) }}' - name: Dump the client payload context env: - PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }} + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request) }} run: echo "$PAYLOAD_CONTEXT" - name: Determine latest commit in the Galaxy repo id: get-galaxy-sha From 6e7b51ec5685fa495ffb93c36129814ffc9fe0ff Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 11:44:25 +0200 Subject: [PATCH 12/32] try to get ref --- .github/workflows/pr.yaml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 3ed2a0a4e55..abc0f549ff3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -30,6 +30,19 @@ jobs: matrix: python-version: ['3.7'] steps: + - name: Print github context properties + run: | + echo 'event: ${{ github.event_name }}' + echo 'sha: ${{ github.sha }}' + echo 'ref: ${{ github.ref }}' + echo 'head_ref: ${{ github.head_ref }}' + echo 'base_ref: ${{ github.base_ref }}' + echo 'event.before: ${{ github.event.before }}' + echo 'event.after: ${{ github.event.after }}' + - name: Dump the client payload context + env: + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request["head"]["ref"]) }} + run: echo "$PAYLOAD_CONTEXT" - name: Add reaction if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} uses: peter-evans/create-or-update-comment@v1 @@ -43,22 +56,11 @@ jobs: run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then echo "::set-output name=update-test-data::true" + echo "::set-output name=ref::${{github.event.client_payload.pull_request["head"]["ref"]}}" else echo "::set-output name=update-test-data::false" + echo "::set-output name=ref::''" fi - - name: Print github context properties - run: | - echo 'event: ${{ github.event_name }}' - echo 'sha: ${{ github.sha }}' - echo 'ref: ${{ github.ref }}' - echo 'head_ref: ${{ github.head_ref }}' - echo 'base_ref: ${{ github.base_ref }}' - echo 'event.before: ${{ github.event.before }}' - echo 'event.after: ${{ github.event.after }}' - - name: Dump the client payload context - env: - PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request) }} - run: echo "$PAYLOAD_CONTEXT" - name: Determine latest commit in the Galaxy repo id: get-galaxy-sha run: echo "::set-output name=galaxy-head-sha::$(git ls-remote https://github.com/${{ env.GALAXY_FORK }}/galaxy refs/heads/${{ env.GALAXY_BRANCH }} | cut -f1)" @@ -87,7 +89,7 @@ jobs: with: fetch-depth: 0 - name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks - uses: galaxyproject/planemo-ci-action@v1 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data id: discover with: create-cache: ${{ steps.cache-pip.outputs.cache-hit != 'true' || steps.cache-planemo.outputs.cache-hit != 'true' }} From bfd65ea06cd0fdedd6a0387d2a702acb7e423d6a Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 11:45:50 +0200 Subject: [PATCH 13/32] try --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index abc0f549ff3..113eb9d8741 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -41,7 +41,7 @@ jobs: echo 'event.after: ${{ github.event.after }}' - name: Dump the client payload context env: - PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request["head"]["ref"]) }} + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.ref) }} run: echo "$PAYLOAD_CONTEXT" - name: Add reaction if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} @@ -56,7 +56,7 @@ jobs: run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then echo "::set-output name=update-test-data::true" - echo "::set-output name=ref::${{github.event.client_payload.pull_request["head"]["ref"]}}" + echo "::set-output name=ref::${{github.event.client_payload.pull_request.ref}}" else echo "::set-output name=update-test-data::false" echo "::set-output name=ref::''" From dcd0c84a41e9c2fcca12e2e923c8d3960a83826a Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 11:48:31 +0200 Subject: [PATCH 14/32] try to use ref --- .github/workflows/pr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 113eb9d8741..a9def0e12ff 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -87,6 +87,7 @@ jobs: run: pip install flake8 flake8-import-order - uses: actions/checkout@v2 with: + ref: ${{ steps.update-test-data.outputs.ref }} fetch-depth: 0 - name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks uses: bernt-matthias/planemo-ci-action@topic/update-test-data From d7023d60776530888322ce49819916850781bbea Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 11:56:04 +0200 Subject: [PATCH 15/32] try --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a9def0e12ff..cb048735fb2 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -56,7 +56,7 @@ jobs: run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then echo "::set-output name=update-test-data::true" - echo "::set-output name=ref::${{github.event.client_payload.pull_request.ref}}" + echo "::set-output name=ref::${{github.event.client_payload.pull_request.sha}}" else echo "::set-output name=update-test-data::false" echo "::set-output name=ref::''" From a7b51d7e6fed611b2449cbf2cff7aa4b23312653 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 12:13:53 +0200 Subject: [PATCH 16/32] try --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cb048735fb2..a390ba6fd01 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -41,7 +41,7 @@ jobs: echo 'event.after: ${{ github.event.after }}' - name: Dump the client payload context env: - PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.ref) }} + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.sha) }} run: echo "$PAYLOAD_CONTEXT" - name: Add reaction if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} @@ -56,7 +56,7 @@ jobs: run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then echo "::set-output name=update-test-data::true" - echo "::set-output name=ref::${{github.event.client_payload.pull_request.sha}}" + echo "::set-output name=ref::${{github.event.client_payload.pull_request.head.sha}}" else echo "::set-output name=update-test-data::false" echo "::set-output name=ref::''" From e1d06f5ef230a8633fae30a2a19d03ede17f2c5d Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 12:28:53 +0200 Subject: [PATCH 17/32] checkout the correct ref in all jobs --- .github/workflows/pr.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a390ba6fd01..59983171544 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,7 +25,8 @@ jobs: tool-list: ${{ steps.discover.outputs.tool-list }} chunk-count: ${{ steps.discover.outputs.chunk-count }} chunk-list: ${{ steps.discover.outputs.chunk-list }} - output-test-data: ${{ steps.output-test-data.outputs.output-test-data }} + output-test-data: ${{ steps.update-test-data.outputs.output-test-data }} + ref: ${{ steps.update-test-data.outputs.ref }} strategy: matrix: python-version: ['3.7'] @@ -43,7 +44,7 @@ jobs: env: PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.sha) }} run: echo "$PAYLOAD_CONTEXT" - - name: Add reaction + - name: Add reaction to update-test-data slash command if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} uses: peter-evans/create-or-update-comment@v1 with: @@ -51,7 +52,10 @@ jobs: 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 update-test-data for slash commands + # for running the update-test-data slash command + # - set update-test-data::true and false otherwise + # - set ref to the PR latest SHA and '' otherwise (which is the default for the checkout action) + - name: Set variables depending on update-test-data for slash commands id: update-test-data run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then @@ -124,6 +128,7 @@ jobs: # and use it as the current working directory - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 with: @@ -160,6 +165,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 with: @@ -192,6 +198,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: r-lib/actions/setup-r@master with: @@ -265,6 +272,7 @@ jobs: # and use it as the current working directory - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 with: @@ -359,6 +367,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 with: From 18f76b4b65ab53abbf1c63afb39c1f5ac605670f Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 13:06:41 +0200 Subject: [PATCH 18/32] always use branch of the action --- .github/workflows/pr.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 59983171544..d392d512839 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -140,7 +140,8 @@ jobs: 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 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data + # uses: galaxyproject/planemo-ci-action@v1 id: lint with: mode: lint @@ -290,7 +291,8 @@ jobs: path: ~/.planemo key: planemo_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }} - name: Planemo test - uses: galaxyproject/planemo-ci-action@v1 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data + # uses: galaxyproject/planemo-ci-action@v1 id: test with: mode: test @@ -340,7 +342,8 @@ jobs: 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 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data + # uses: galaxyproject/planemo-ci-action@v1 id: combine with: mode: combine @@ -350,7 +353,8 @@ jobs: name: 'All tool test results' path: upload - name: Check outputs - uses: galaxyproject/planemo-ci-action@v1 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data + # uses: galaxyproject/planemo-ci-action@v1 id: check with: mode: check @@ -379,7 +383,8 @@ jobs: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }} - name: Deploy on testtoolshed - uses: galaxyproject/planemo-ci-action@v1 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data + # uses: galaxyproject/planemo-ci-action@v1 with: mode: deploy repository-list: ${{ needs.setup.outputs.repository-list }} @@ -387,7 +392,8 @@ jobs: shed-key: ${{ secrets.TTS_API_KEY }} continue-on-error: true - name: Deploy on toolshed - uses: galaxyproject/planemo-ci-action@v1 + uses: bernt-matthias/planemo-ci-action@topic/update-test-data + # uses: galaxyproject/planemo-ci-action@v1 with: mode: deploy repository-list: ${{ needs.setup.outputs.repository-list }} From 81bd1e04ad029d10741fa570d3de6688f93bff62 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 13:19:56 +0200 Subject: [PATCH 19/32] try ref instead of sha --- .github/workflows/pr.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d392d512839..fac9b259577 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -42,7 +42,7 @@ jobs: echo 'event.after: ${{ github.event.after }}' - name: Dump the client payload context env: - PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.sha) }} + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.ref) }} run: echo "$PAYLOAD_CONTEXT" - name: Add reaction to update-test-data slash command if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} @@ -60,7 +60,7 @@ jobs: run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then echo "::set-output name=update-test-data::true" - echo "::set-output name=ref::${{github.event.client_payload.pull_request.head.sha}}" + echo "::set-output name=ref::${{github.event.client_payload.pull_request.head.ref}}" else echo "::set-output name=update-test-data::false" echo "::set-output name=ref::''" @@ -303,7 +303,7 @@ jobs: chunk-count: ${{ needs.setup.outputs.chunk-count }} update-test-data: ${{ needs.setup.outputs.update-test-date }} - name: Push updated test data - if: ${{ needs.setup.outputs.update-test-date }} + if: ${{ needs.setup.outputs.update-test-data }} run: | git config user.name github-actions git config user.email github-actions@github.com From 8e0cf316c464c871c9ca416d9ee79521f43d55e0 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 13:29:23 +0200 Subject: [PATCH 20/32] only push if changed --- .github/workflows/pr.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index fac9b259577..f9bb0f23bf0 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -42,7 +42,7 @@ jobs: echo 'event.after: ${{ github.event.after }}' - name: Dump the client payload context env: - PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request.head.ref) }} + PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload.pull_request) }} run: echo "$PAYLOAD_CONTEXT" - name: Add reaction to update-test-data slash command if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} @@ -305,11 +305,13 @@ jobs: - name: Push updated test data if: ${{ needs.setup.outputs.update-test-data }} run: | - git config user.name github-actions - git config user.email github-actions@github.com - git add . - git commit -m "update test data" - git push + if git diff --exit-code; then + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "update test data" + git push + fi - uses: actions/upload-artifact@v2 with: name: 'Tool test output ${{ matrix.chunk }}' From 48db873883f8f3cc067b42118e37eb15e90016c5 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 13:53:21 +0200 Subject: [PATCH 21/32] checkout from fork for dispactch event --- .github/workflows/pr.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f9bb0f23bf0..fae0833bb00 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -26,6 +26,7 @@ jobs: chunk-count: ${{ steps.discover.outputs.chunk-count }} chunk-list: ${{ steps.discover.outputs.chunk-list }} output-test-data: ${{ steps.update-test-data.outputs.output-test-data }} + repository: ${{ steps.update-test-data.outputs.repository }} ref: ${{ steps.update-test-data.outputs.ref }} strategy: matrix: @@ -60,9 +61,11 @@ jobs: run: | if [ -n "${{ github.event.client_payload.slash_command.command}}" ]; then echo "::set-output name=update-test-data::true" + echo "::set-output name=repository::${{github.event.client_payload.pull_request.head.repo.full_name}}" echo "::set-output name=ref::${{github.event.client_payload.pull_request.head.ref}}" else echo "::set-output name=update-test-data::false" + echo "::set-output name=repository::''" echo "::set-output name=ref::''" fi - name: Determine latest commit in the Galaxy repo @@ -91,6 +94,7 @@ jobs: run: pip install flake8 flake8-import-order - uses: actions/checkout@v2 with: + ref: ${{ steps.update-test-data.outputs.repository }} ref: ${{ steps.update-test-data.outputs.ref }} fetch-depth: 0 - name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks @@ -128,6 +132,7 @@ jobs: # and use it as the current working directory - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 @@ -166,6 +171,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 @@ -199,6 +205,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: r-lib/actions/setup-r@master @@ -273,6 +280,7 @@ jobs: # and use it as the current working directory - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 @@ -373,6 +381,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 From 531d711a595e0175be23431f0562ebb7cb8e6cff Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 13:55:48 +0200 Subject: [PATCH 22/32] fix --- .github/workflows/pr.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index fae0833bb00..cf792f144ab 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -94,7 +94,7 @@ jobs: run: pip install flake8 flake8-import-order - uses: actions/checkout@v2 with: - ref: ${{ steps.update-test-data.outputs.repository }} + repository: ${{ steps.update-test-data.outputs.repository }} ref: ${{ steps.update-test-data.outputs.ref }} fetch-depth: 0 - name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks @@ -132,7 +132,7 @@ jobs: # and use it as the current working directory - uses: actions/checkout@v2 with: - ref: ${{ needs.setup.outputs.repository }} + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 @@ -171,7 +171,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ needs.setup.outputs.repository }} + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 @@ -205,7 +205,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ needs.setup.outputs.repository }} + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: r-lib/actions/setup-r@master @@ -280,7 +280,7 @@ jobs: # and use it as the current working directory - uses: actions/checkout@v2 with: - ref: ${{ needs.setup.outputs.repository }} + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 @@ -381,7 +381,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ needs.setup.outputs.repository }} + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} fetch-depth: 1 - uses: actions/setup-python@v1 From 2fd0bd85f6ddd7532de4eef8279839fd4ed93dcb Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 14:08:11 +0200 Subject: [PATCH 23/32] fix variable name --- .github/workflows/pr.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cf792f144ab..fe8dc5103ab 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,7 +25,7 @@ jobs: tool-list: ${{ steps.discover.outputs.tool-list }} chunk-count: ${{ steps.discover.outputs.chunk-count }} chunk-list: ${{ steps.discover.outputs.chunk-list }} - output-test-data: ${{ steps.update-test-data.outputs.output-test-data }} + update-test-data: ${{ steps.update-test-data.outputs.update-test-data }} repository: ${{ steps.update-test-data.outputs.repository }} ref: ${{ steps.update-test-data.outputs.ref }} strategy: @@ -55,7 +55,7 @@ jobs: reaction-type: hooray # for running the update-test-data slash command # - set update-test-data::true and false otherwise - # - set ref to the PR latest SHA and '' otherwise (which is the default for the checkout action) + # - set repository / ref to the PR fork name / latest SHA and '' otherwise (which is the default for the checkout action) - name: Set variables depending on update-test-data for slash commands id: update-test-data run: | @@ -309,7 +309,7 @@ jobs: galaxy-branch: ${{ env.GALAXY_BRANCH }} chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup.outputs.chunk-count }} - update-test-data: ${{ needs.setup.outputs.update-test-date }} + update-test-data: ${{ needs.setup.outputs.update-test-data }} - name: Push updated test data if: ${{ needs.setup.outputs.update-test-data }} run: | From 13aaf3712bdb19961bfb1536768ea9ad3e4c485e Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 14:25:46 +0200 Subject: [PATCH 24/32] try to commit only if modifying changes are piresent add resonse comment --- .github/workflows/pr.yaml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index fe8dc5103ab..19106dc6f60 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,7 +25,7 @@ jobs: tool-list: ${{ steps.discover.outputs.tool-list }} chunk-count: ${{ steps.discover.outputs.chunk-count }} chunk-list: ${{ steps.discover.outputs.chunk-list }} - update-test-data: ${{ steps.update-test-data.outputs.update-test-data }} + output-test-data: ${{ steps.update-test-data.outputs.output-test-data }} repository: ${{ steps.update-test-data.outputs.repository }} ref: ${{ steps.update-test-data.outputs.ref }} strategy: @@ -309,17 +309,36 @@ jobs: galaxy-branch: ${{ env.GALAXY_BRANCH }} chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup.outputs.chunk-count }} - update-test-data: ${{ needs.setup.outputs.update-test-data }} + update-test-data: ${{ needs.setup.outputs.update-test-date }} - name: Push updated test data + id: push-updated-test-data if: ${{ needs.setup.outputs.update-test-data }} run: | - if git diff --exit-code; then + if git diff --diff-filter=M --exit-code; then git config user.name github-actions git config user.email github-actions@github.com - git add . - git commit -m "update test data" + git commit -m "update test data" . git push fi + - name: Create URL to the run output + if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} + id: vars + run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + - name: Create comment + if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} + uses: peter-evans/create-or-update-comment@v1 + 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: + + ${{ toJson(steps.push-updated-test-data.outputs) }} + + [Find all tool test results here][1] + + [1]: ${{ steps.vars.outputs.run-url }} - uses: actions/upload-artifact@v2 with: name: 'Tool test output ${{ matrix.chunk }}' From e6df18893370f1c14aaee1a1a51ed6dfc3e91152 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 14:43:01 +0200 Subject: [PATCH 25/32] typos --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 19106dc6f60..71169f53aea 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,7 +25,7 @@ jobs: tool-list: ${{ steps.discover.outputs.tool-list }} chunk-count: ${{ steps.discover.outputs.chunk-count }} chunk-list: ${{ steps.discover.outputs.chunk-list }} - output-test-data: ${{ steps.update-test-data.outputs.output-test-data }} + update-test-data: ${{ steps.update-test-data.outputs.update-test-data }} repository: ${{ steps.update-test-data.outputs.repository }} ref: ${{ steps.update-test-data.outputs.ref }} strategy: @@ -309,7 +309,7 @@ jobs: galaxy-branch: ${{ env.GALAXY_BRANCH }} chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup.outputs.chunk-count }} - update-test-data: ${{ needs.setup.outputs.update-test-date }} + update-test-data: ${{ needs.setup.outputs.update-test-data }} - name: Push updated test data id: push-updated-test-data if: ${{ needs.setup.outputs.update-test-data }} From d613b1e462eed0c6452a397ebd23c5c05a52300a Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 15:18:30 +0200 Subject: [PATCH 26/32] mod git diff --- .github/workflows/pr.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 71169f53aea..a4c88a59b21 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -311,17 +311,21 @@ jobs: chunk-count: ${{ needs.setup.outputs.chunk-count }} update-test-data: ${{ needs.setup.outputs.update-test-data }} - name: Push updated test data - id: push-updated-test-data if: ${{ needs.setup.outputs.update-test-data }} + id: push-updated-test-data run: | - if git diff --diff-filter=M --exit-code; then + set -x + if git diff HEAD^..HEAD --diff-filter=M --exit-code; then git config user.name github-actions git config user.email github-actions@github.com git commit -m "update test data" . - git push + git push + echo "::set-output name=number-of-changed-files::$(git diff HEAD^..HEAD --name-only | wc -l)" + else + echo "::set-output name=number-of-changed-files::0" fi - name: Create URL to the run output - if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} + if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} id: vars run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - name: Create comment @@ -332,9 +336,7 @@ jobs: repository: ${{ github.event.client_payload.github.payload.repository.full_name }} issue-number: ${{ github.event.client_payload.github.payload.issue.number }} body: | - Summary: - - ${{ toJson(steps.push-updated-test-data.outputs) }} + Summary: ${{ steps.push-updated-test-data.outputs.number-of-changed-files }} files changed [Find all tool test results here][1] From 7da299497fbfa8d170d2c2f37bc33756f6d8435b Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 15:49:38 +0200 Subject: [PATCH 27/32] revert diff chnage --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a4c88a59b21..0c36f83d764 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -315,7 +315,7 @@ jobs: id: push-updated-test-data run: | set -x - if git diff HEAD^..HEAD --diff-filter=M --exit-code; then + if git diff --diff-filter=M --exit-code; then git config user.name github-actions git config user.email github-actions@github.com git commit -m "update test data" . From 8a70250a7476055fc3307a13d031826da772cde8 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 17:17:16 +0200 Subject: [PATCH 28/32] fix if --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0c36f83d764..a53909cf0e9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -315,7 +315,7 @@ jobs: id: push-updated-test-data run: | set -x - if git diff --diff-filter=M --exit-code; then + if ! git diff --diff-filter=M --exit-code >& /dev/null; then git config user.name github-actions git config user.email github-actions@github.com git commit -m "update test data" . From 0f420382c0701f4fca8925dbc8a957356e8f2ecf Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 17:40:20 +0200 Subject: [PATCH 29/32] reenable push and pr --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a53909cf0e9..c9a8ac56c4c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,7 +1,7 @@ name: Galaxy Tool Linting and Tests for push and PR on: - # push: - # pull_request: + push: + pull_request: repository_dispatch: types: [update-test-data-command] env: From 34a22485783285130a8a92eba1c1fcaa201d8cb1 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 21:44:50 +0200 Subject: [PATCH 30/32] try to fix empty string --- .github/workflows/pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c9a8ac56c4c..6a632d6b374 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -65,8 +65,8 @@ jobs: echo "::set-output name=ref::${{github.event.client_payload.pull_request.head.ref}}" else echo "::set-output name=update-test-data::false" - echo "::set-output name=repository::''" - echo "::set-output name=ref::''" + echo "::set-output name=repository::" + echo "::set-output name=ref::" fi - name: Determine latest commit in the Galaxy repo id: get-galaxy-sha From 8717c96ca681f091638d0cd3b70fd7b8816de9a6 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 8 Sep 2021 22:15:02 +0200 Subject: [PATCH 31/32] do not run linters for dispatch actions --- .github/workflows/pr.yaml | 47 +++++++++++++-------------------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 6a632d6b374..3af6f0b34da 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -121,7 +121,7 @@ jobs: lint: name: Lint tool-list needs: setup - if: ${{ needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '' }} + if: ${{ github.event_name != 'repository-dispatch' && (needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '') }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -162,7 +162,7 @@ jobs: flake8: name: Lint Python scripts needs: setup - if: ${{ needs.setup.outputs.repository-list != '' }} + if: ${{ github.event_name != 'repository-dispatch' && needs.setup.outputs.repository-list != '' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -196,7 +196,7 @@ jobs: lintr: name: Lint R scripts needs: setup - if: ${{ needs.setup.outputs.repository-list != '' }} + if: ${{ github.event_name != 'repository-dispatch' && needs.setup.outputs.repository-list != '' }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -310,6 +310,12 @@ jobs: chunk: ${{ matrix.chunk }} chunk-count: ${{ needs.setup.outputs.chunk-count }} update-test-data: ${{ needs.setup.outputs.update-test-data }} + - uses: actions/upload-artifact@v2 + with: + name: 'Tool test output ${{ matrix.chunk }}' + path: upload + # push updated test data + # - if no test data was updated then create a note (otherwise the commit should be sufficient) - name: Push updated test data if: ${{ needs.setup.outputs.update-test-data }} id: push-updated-test-data @@ -325,26 +331,22 @@ jobs: echo "::set-output name=number-of-changed-files::0" fi - name: Create URL to the run output - if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} + if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' && steps.push-updated-test-data.outputs.number-of-changed-files != 0 }} id: vars run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - name: Create comment - if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' }} + if: ${{ github.event.client_payload.slash_command.command == 'update-test-data' && steps.push-updated-test-data.outputs.number-of-changed-files != 0 }} uses: peter-evans/create-or-update-comment@v1 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.push-updated-test-data.outputs.number-of-changed-files }} files changed + No test data was updated [Find all tool test results here][1] [1]: ${{ steps.vars.outputs.run-url }} - - uses: actions/upload-artifact@v2 - 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 @@ -354,7 +356,7 @@ jobs: combine_outputs: name: Combine chunked test results needs: [setup, test] - if: ${{ needs.setup.outputs.repository-list != '' }} + if: ${{ github.event_name != 'repository-dispatch' && needs.setup.outputs.repository-list != '' }} runs-on: ubuntu-latest strategy: matrix: @@ -394,7 +396,7 @@ jobs: deploy: name: Deploy needs: [setup, lint, flake8, lintr, combine_outputs] - if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) && github.repository_owner == 'galaxyproject' }} + if: ${{ github.event_name != 'repository-dispatch' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) && github.repository_owner == 'galaxyproject' }} runs-on: ubuntu-latest strategy: matrix: @@ -435,28 +437,9 @@ jobs: determine-success: name: Check workflow success needs: [setup, lint, flake8, lintr, combine_outputs] - if: ${{ always() && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} + if: ${{ always() && github.event_name != 'repository-dispatch' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest steps: - - name: Create URL to the run output - if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} - id: vars - run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" - - name: Create comment - if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }} - uses: peter-evans/create-or-update-comment@v1 - 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 tool lint status if: ${{ needs.lint.result != 'success' && needs.flake8.result != 'skipped' }} run: exit 1 From 9789f9d387b97cf696840b697df9e7a294498b6b Mon Sep 17 00:00:00 2001 From: Simon Bray <32272674+simonbray@users.noreply.github.com> Date: Wed, 8 Sep 2021 18:06:42 +0200 Subject: [PATCH 32/32] test changing test data --- tools/abricate/test-data/output_noresults.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/abricate/test-data/output_noresults.txt b/tools/abricate/test-data/output_noresults.txt index 9423b576eb1..2698470473b 100644 --- a/tools/abricate/test-data/output_noresults.txt +++ b/tools/abricate/test-data/output_noresults.txt @@ -1 +1 @@ -#FILE SEQUENCE START END STRAND GENE COVERAGE COVERAGE_MAP GAPS %COVERAGE %IDENTITY DATABASE ACCESSION PRODUCT RESISTANCE +#FILE SEQUENCE START END STRAND GENE COVERAGE COVERAGE_MAP GAPS %COVERAGE %IDENTITY DATABASE ACCESSION