Skip to content

Commit

Permalink
Update, to better detect deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
rasben committed Oct 18, 2023
1 parent bb9d305 commit 7cca6e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
PLATFORMSH_ID: ${{ secrets.TEST_PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ secrets.TEST_PLATFORMSH_KEY }}
ENVIRONMENT_NAME: main
ENVIRONMENT_NAME: master

fail-deploy-test:
name: "Testing on a environment that has a failed deployment"
Expand All @@ -23,24 +23,23 @@ jobs:
- uses: actions/checkout@v2

- uses: ./
id: inactive_url
id: failed_url
continue-on-error: true
with:
PLATFORMSH_ID: ${{ secrets.TEST_PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ secrets.TEST_PLATFORMSH_KEY }}
ENVIRONMENT_NAME: main
ENVIRONMENT_NAME: master
DEPLOY_STATUS_PATH: '/sites/default/files/mock-deploy-status'

- name: Check for failure
if: ${{ steps.inactive_url.outputs.url }}
if: ${{ steps.failed_url.outputs.url }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('The test did not fail as expected.')
missing-url-test:
name: "Testing on a environment that that has no URL"
name: "Testing on a environment that does not exist"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -51,8 +50,7 @@ jobs:
with:
PLATFORMSH_ID: ${{ secrets.TEST_PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ secrets.TEST_PLATFORMSH_KEY }}
ENVIRONMENT_NAME: main
DEPLOY_STATUS_PATH: '/sites/default/files/xxx-deploy-status'
ENVIRONMENT_NAME: nonexistent

- name: Check for failure
if: ${{ steps.missing_url.outputs.url }}
Expand Down
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ inputs:
required: false
type: string

DEPLOY_WAIT_TIME:
description: "How long should we maximum wait for the deploy to work? If the branch doesnt exist in the PlatformSH GIT Remote, this is how long the action will take. Actually inactive environments get detected instantly. Default: 1000 seconds."
default: 1000
PSH_DETECTION_WAIT:
description: "How long should we maximum wait for PSH to detect the push? If the branch doesnt exist in the PlatformSH GIT Remote, this is how long the action will take. Actually inactive environments get detected instantly. Default: 120 seconds."
default: 120
required: false
type: integer

Expand All @@ -53,7 +53,7 @@ runs:
PLATFORMSH_ID: ${{ inputs.PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ inputs.PLATFORMSH_KEY }}
ENVIRONMENT_NAME: ${{ inputs.ENVIRONMENT_NAME }}
DEPLOY_WAIT_TIME: ${{ inputs.DEPLOY_WAIT_TIME }}
PSH_DETECTION_WAIT: ${{ inputs.PSH_DETECTION_WAIT }}
ALLOW_CANCEL_CRON: ${{ inputs.ALLOW_CANCEL_CRON }}

- name: Check latest deploy status
Expand Down

0 comments on commit 7cca6e8

Please sign in to comment.