Skip to content

Commit

Permalink
include ct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Asvarox committed Oct 16, 2024
1 parent 3a6fc72 commit 04577de
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 42 deletions.
84 changes: 43 additions & 41 deletions .github/workflows/ci-improvement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,6 @@ jobs:
packagescript: 'e2e'
shard: '${{ matrix.shardIndex }}'
shardTotal: '${{ matrix.shardTotal }}'
e2e-tests-merge:
runs-on: ubuntu-latest
# Merge reports after e2e-tests-run, even if some shards have failed
if: ${{ !cancelled() }}
needs: e2e-tests-run
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: './.github/templates/setup-node'
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: test-results-blob-e2e-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload merged report
id: deploy-report
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy playwright-report --project-name=allkaraoke-party-tests-results
- uses: actions/github-script@v7
env:
DEPLOYMENT_URL: ${{ steps.deploy-report.outputs.deployment-url }}
DEPLOYMENT_ALIAS_URL: ${{ steps.deploy-report.outputs.deployment-alias-url }}
with:
script: |
core.summary.addRaw(`
# Deploying with Cloudflare Pages
| Name | Result |
| ----------------------- | - |
| **Preview URL**: | ${process.env.DEPLOYMENT_URL} |
| **Branch Preview URL**: | ${process.env.DEPLOYMENT_ALIAS_URL} |
`
).write();
ct-tests-run:
permissions:
contents: write # https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#usage
Expand Down Expand Up @@ -122,6 +81,49 @@ jobs:
body: 'Changes detected in visual regression tests. Please review.',
event: 'COMMENT',
})
e2e-tests-merge:
runs-on: ubuntu-latest
# Merge reports after e2e-tests-run, even if some shards have failed
if: ${{ !cancelled() }}
needs:
- e2e-tests-run
- ct-tests-run
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: './.github/templates/setup-node'
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: test-results-blob-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload merged report
id: deploy-report
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy playwright-report --project-name=allkaraoke-party-tests-results
- uses: actions/github-script@v7
env:
DEPLOYMENT_URL: ${{ steps.deploy-report.outputs.deployment-url }}
DEPLOYMENT_ALIAS_URL: ${{ steps.deploy-report.outputs.deployment-alias-url }}
with:
script: |
core.summary.addRaw(`
# Deploying with Cloudflare Pages
| Name | Result |
| ----------------------- | - |
| **Preview URL**: | ${process.env.DEPLOYMENT_URL} |
| **Branch Preview URL**: | ${process.env.DEPLOYMENT_ALIAS_URL} |
`
).write();
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
2 changes: 1 addition & 1 deletion playwright-ct.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const config: PlaywrightTestConfig = defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: [...(process.env.CI ? ([['github'], ['blob']] as any) : ([['list'], ['html']] as any))],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
testIdAttribute: 'data-test',
Expand Down

0 comments on commit 04577de

Please sign in to comment.