name: PR Update
on:
pull_request_target:
branches:
- main
paths-ignore:
- "**.md"
- ".github/CODEOWNERS"
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
app-store: ${{ steps.filter.outputs.app-store }}
embed: ${{ steps.filter.outputs.embed }}
embed-react: ${{ steps.filter.outputs.embed-react }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/dangerous-git-checkout
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
app-store:
- 'apps/web/**'
- 'packages/app-store/**'
embed:
- 'packages/embeds/**'
embed-react:
env:
name: Create env file
uses: ./.github/workflows/env-create-file.yml
secrets: inherit
type-check:
name: Type check
uses: ./.github/workflows/check-types.yml
test:
name: Unit tests
uses: ./.github/workflows/test.yml
lint:
name: Linters
uses: ./.github/workflows/lint.yml
build:
name: Production build
needs: env
uses: ./.github/workflows/production-build.yml
e2e:
name: E2E tests
needs: [changes, lint, build]
uses: ./.github/workflows/e2e.yml
e2e-app-store:
name: E2E App Store tests
if: ${{ needs.changes.outputs.app-store == 'true' }}
uses: ./.github/workflows/e2e-app-store.yml
e2e-embed:
name: E2E embeds tests
if: ${{ needs.changes.outputs.embed == 'true' }}
uses: ./.github/workflows/e2e-embed.yml
e2e-embed-react:
name: E2E React embeds tests
if: ${{ needs.changes.outputs.embed-react == 'true' }}
uses: ./.github/workflows/e2e-embed-react.yml
analyze:
needs: build
uses: ./.github/workflows/nextjs-bundle-analysis.yml
required:
needs: [lint, type-check, test, build, e2e]
if: always()
- name: fail if conditional jobs failed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')
run: exit 1