Test commit without version tag #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Checks | |
on: | |
pull_request: | |
branches: | |
- main | |
# Defaults + ready_for_review to trigger a re-run when a Draft PR is converted to a normal PR | |
# See: https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 | |
types: [opened, synchronize, reopened, ready_for_review] | |
# See: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
permissions: | |
contents: read | |
pull-requests: read | |
# Only allow one build per PR source branch to run at once, cancelling in-progress | |
# builds when new builds arrive | |
# See: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
# Checks if the PR is in draft status and fails if so, which does 2 things: | |
# - Prevents the PR from being merged in that state | |
# - Prevents all downstream jobs from running | |
# Additionally, require each test to pass before running the next to prevent | |
# running unnecessary jobs if any upstream jobs already failed | |
draft: | |
name: 'Check Draft Status' | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Fail draft PRs' | |
if: github.event.pull_request.draft == true | |
run: | | |
echo "Skipping execution for draft PR" | |
exit 1 | |
- run: echo "PR is not Draft" | |
# Check Linting status | |
lint: | |
uses: ./.github/workflows/run-npm-script.yml | |
needs: draft | |
with: | |
label: 'Lint' | |
script: 'npm run lint' | |
# Run Jest Unit Tests | |
test-unit: | |
uses: ./.github/workflows/run-npm-script.yml | |
needs: draft | |
with: | |
label: 'Test: Unit' | |
script: 'npm run test:unit' | |
# Run Cypress End to End Tests | |
test-e2e: | |
uses: ./.github/workflows/test-e2e.yml | |
needs: draft | |
secrets: | |
record-key: d1f04332-8bb9-4570-90e4-7c29b9510ee3 | |
github-token: ${{ secrets.GITHUB_TOKEN }} |