Skip to content

Commit

Permalink
refactor(ci): refactor quantic jobs into reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Feb 26, 2024
1 parent acc9ac8 commit 42d0a84
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 88 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/e2e-quantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
workflow_run:
secrets:
SFDX_AUTH_CLIENT_ID:
required: true
SFDX_AUTH_JWT_KEY:
required: true
GITHUB_TOKEN:
required: true
jobs:
e2e-quantic-setup:
name: 'Setup e2e tests on Quantic'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- uses: ./.github/actions/e2e-quantic-setup
with:
clientid: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
jwtkey: ${{ secrets.SFDX_AUTH_JWT_KEY }}
e2e-quantic-test:
name: 'Run e2e tests on Quantic'
needs: e2e-quantic-setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
spec:
[
'cypress/e2e/default-1/**/*',
'cypress/e2e/default-2/**/*',
'cypress/e2e/facets-1/**/*',
'cypress/e2e/facets-2/**/*',
]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- uses: ./.github/actions/e2e-quantic
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
spec: ${{ matrix.spec }}
e2e-quantic-cleanup:
if: cancelled() || failure() || success()
needs: e2e-quantic-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- run: npx --no-install ts-node packages/quantic/scripts/build/delete-org.ts
shell: bash
50 changes: 6 additions & 44 deletions .github/workflows/masterbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,50 +170,12 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-headless-ssr-pages-prod
e2e-quantic-setup:
name: 'Setup e2e tests on Quantic'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- uses: ./.github/actions/e2e-quantic-setup
with:
clientid: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
jwtkey: ${{ secrets.SFDX_AUTH_JWT_KEY }}
e2e-quantic-test:
name: 'Run e2e tests on Quantic'
needs: e2e-quantic-setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
spec:
[
'cypress/e2e/default-1/**/*',
'cypress/e2e/default-2/**/*',
'cypress/e2e/facets-1/**/*',
'cypress/e2e/facets-2/**/*',
]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- uses: ./.github/actions/e2e-quantic
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
spec: ${{ matrix.spec }}
e2e-quantic-cleanup:
if: cancelled() || failure() || success()
needs: e2e-quantic-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- run: npx --no-install ts-node packages/quantic/scripts/build/delete-org.ts
shell: bash
e2e-quantic:
uses: ./.github/workflows/e2e-quantic.yml
secrets:
SFDX_AUTH_CLIENT_ID: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
SFDX_AUTH_JWT_KEY: ${{ secrets.SFDX_AUTH_JWT_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
prerelease:
timeout-minutes: 40
name: Pre-release
Expand Down
51 changes: 7 additions & 44 deletions .github/workflows/prbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,57 +221,20 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-headless-ssr-pages-prod
e2e-quantic-setup:
name: 'Setup e2e tests on Quantic'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- uses: ./.github/actions/e2e-quantic-setup
with:
clientid: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
jwtkey: ${{ secrets.SFDX_AUTH_JWT_KEY }}
e2e-quantic-test:
name: 'Run e2e tests on Quantic'
needs: e2e-quantic-setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
spec:
[
'cypress/e2e/default-1/**/*',
'cypress/e2e/default-2/**/*',
'cypress/e2e/facets-1/**/*',
'cypress/e2e/facets-2/**/*',
]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/e2e-quantic
- uses: ./.github/actions/setup-sfdx
with:
spec: ${{ matrix.spec }}
e2e-quantic-cleanup:
if: cancelled() || failure() || success()
needs: e2e-quantic-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- run: npx --no-install ts-node packages/quantic/scripts/build/delete-org.ts
shell: bash
e2e-quantic:
uses: ./.github/workflows/e2e-quantic.yml
secrets:
SFDX_AUTH_CLIENT_ID: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
SFDX_AUTH_JWT_KEY: ${{ secrets.SFDX_AUTH_JWT_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
required-jobs:
if: success()
needs:
- 'build'
- 'lint-check'
- 'unit-test'
- 'e2e-atomic-test'
- 'e2e-quantic-test'
- 'e2e-quantic'
- 'e2e-atomic-screenshots'
- 'e2e-atomic-react-test'
- 'e2e-atomic-react-nextjs-test'
Expand Down

0 comments on commit 42d0a84

Please sign in to comment.