allows packages to require QA

This commit is contained in:
Jacob Heider 2023-06-04 03:08:05 -04:00 committed by Jacob Heider
parent d5d1066060
commit caa7f8a444
3 changed files with 42 additions and 0 deletions

22
.github/actions/request-qa/action.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: tea/pantry/request-qa
description: Requests QA for a new version of a project
inputs:
project:
description: projects to request QA for
required: true
slack-webhook:
description: slack webhook to send message to
required: false
runs:
using: composite
steps:
- uses: slackapi/slack-github-action@v1
with:
payload: |
{
"text": "# QA requested for ${{ inputs.project }}\n\n${{ inputs.project }} has a new version available. Please test it out and let us know if there are any issues.\n\n- `qa.ts ${{ inputs.project }} --test` to test it out\n- `qa.ts ${{ inputs.project }} --approve` to approve it for production.\n- `qa.ts ${{ inputs.project }} --reject` will reject it and delete the artifacts."
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.slack-webhook }}

View file

@ -17,6 +17,9 @@ on:
pr: pr:
description: "The PR number" description: "The PR number"
value: ${{ jobs.bottle.outputs.pr }} value: ${{ jobs.bottle.outputs.pr }}
qa-required:
description: "Whether QA is required"
value: ${{ jobs.upload.outputs.qa-required }}
jobs: jobs:
get-platform: get-platform:
@ -127,6 +130,8 @@ jobs:
needs: [get-platform, bottle] needs: [get-platform, bottle]
if: ${{ !inputs.new-version || needs.get-platform.outputs.available != '' }} if: ${{ !inputs.new-version || needs.get-platform.outputs.available != '' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
qa-required: ${{ steps.upload.outputs.qa-required }}
steps: steps:
- uses: teaxyz/brewkit/actions/setup-brewkit@v0 - uses: teaxyz/brewkit/actions/setup-brewkit@v0
with: with:
@ -152,10 +157,12 @@ jobs:
checksums: ${{ env.checksums }} checksums: ${{ env.checksums }}
signatures: ${{ env.signatures }} signatures: ${{ env.signatures }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_S3_STAGING_BUCKET: ${{ secrets.AWS_S3_CACHE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- uses: chetan/invalidate-cloudfront-action@v2 - uses: chetan/invalidate-cloudfront-action@v2
if: ${{ steps.upload.outputs.cf-invalidation-paths != '' }}
env: env:
PATHS: ${{ steps.upload.outputs.cf-invalidation-paths }} PATHS: ${{ steps.upload.outputs.cf-invalidation-paths }}
DISTRIBUTION: ${{ secrets.AWS_CF_DISTRIBUTION_ID }} DISTRIBUTION: ${{ secrets.AWS_CF_DISTRIBUTION_ID }}

View file

@ -42,6 +42,19 @@ jobs:
projects: ${{ inputs.projects }} projects: ${{ inputs.projects }}
secrets: inherit secrets: inherit
request-qa:
needs: [bottle]
if: ${{ needs.bottle.outputs.qa-required != '[]' }}
runs-on: ubuntu-latest
strategy:
matrix:
project: ${{ fromJson(needs.bottle.outputs.qa-required) }}
steps:
- uses: teaxyz/pantry/.github/actions/request-qa@v0
with:
project: ${{ matrix.project }}
slack-webhook: ${{ secrets.SLACK_QA_WEBHOOK }}
complain: complain:
needs: [build, bottle] needs: [build, bottle]
if: failure() if: failure()