From fca9de6c93b53395a994bfa2271f3e5ba84d7c3f Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 28 Jan 2021 00:24:28 +0100 Subject: [PATCH] chore: update workflow again --- .github/workflows/tugboat.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tugboat.yml b/.github/workflows/tugboat.yml index da67be58b4..53fcd2e873 100644 --- a/.github/workflows/tugboat.yml +++ b/.github/workflows/tugboat.yml @@ -1,7 +1,29 @@ name: Tugboat E2E Tests on: deployment_status - jobs: + set-pending: + if: github.event.deployment_status.state != 'success' && github.event.deployment_status.state != 'failed' + name: Run tests against Tugboat + runs-on: ubuntu-latest + steps: + # Set an initial commit status message to indicate that the tests are + # running. + - name: set pending status + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} + debug: true + script: | + return github.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.sha, + state: 'pending', + context: 'Backstage Tugboat E2E Tests', + description: 'Running tests', + target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + }); + run-tests: # Only run after a successful Tugboat deployment. if: github.event.deployment_status.state == 'success' @@ -21,9 +43,9 @@ jobs: repo: context.repo.repo, sha: context.sha, state: 'pending', - context: 'Nightwatch.js tests', + context: 'Backstage Tugboat E2E Tests', description: 'Running tests', - target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" }); - uses: actions/checkout@v1 @@ -57,8 +79,8 @@ jobs: return result.data.environment_url; - name: echo tugboat preview url run: | - echo ${{ steps.get-status-env.outputs.result }} + echo ${{steps.get-status-env.outputs.result}} # The first time you hit a Tugboat URL it can take a while to load, so # we visit it once here to prime it. Otherwise the very first test # will often timeout. - curl ${{ steps.get-status-env.outputs.result }} + curl ${{steps.get-status-env.outputs.result}}