-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
name: main | ||
|
||
on: [push] | ||
on: | ||
push: | ||
paths: | ||
- "**" | ||
|
||
jobs: | ||
main: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,64 @@ | ||
name: Recuring live test | ||
|
||
on: | ||
deployment_status: | ||
schedule: | ||
- cron: "0 12 * * *" | ||
- cron: "0 12 */3 * *" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
app_url: | ||
type: string | ||
description: url to test | ||
default: https://timezone.rocks | ||
required: true | ||
|
||
jobs: | ||
e2e: | ||
uses: ./.github/workflows/_test-e2e.yml | ||
with: | ||
APP_URL: "https://timezone.rocks" | ||
APP_URL: ${{ inputs.app_url || 'https://timezone.rocks' }} | ||
|
||
report: | ||
runs-on: ubuntu-latest | ||
needs: [e2e] | ||
if: always() | ||
steps: | ||
- run: echo ${{ github.event_name}} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: blob-report | ||
pattern: e2e-blob-report-* | ||
merge-multiple: true | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- run: bunx playwright merge-reports --reporter line blob-report | tee report.txt | ||
|
||
- run: echo failed=`cat report.txt | grep failed` >> "$GITHUB_OUTPUT" | ||
id: status | ||
|
||
- name: upload html report | ||
id: report-upload | ||
if: steps.status.outputs.failed | ||
run: | | ||
bunx playwright merge-reports --reporter html blob-report | ||
bunx wrangler pages deploy playwright-report --project-name=timezone-rocks --branch=test-report | tee deploy_out.txt | ||
URL=`cat deploy_out.txt | grep -Eo "https://[^ ]*"` | ||
echo url=$URL >> "$GITHUB_OUTPUT" | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_PUBLISH_TOKEN }} | ||
|
||
- name: Leave comment with the report | ||
if: steps.status.outputs.failed && github.event_name == 'schedule' | ||
run: | | ||
echo "🚨 e2e test failed [report](${{ steps.report-upload.outputs.url }}) [run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) [app](${{ inputs.app_url || 'https://timezone.rocks' }})" >> body.txt | ||
echo "\`\`\`" >> body.txt | ||
cat report.txt | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" >> body.txt # remove colors | ||
echo "\`\`\`" >> body.txt | ||
gh issue comment 15 --body-file body.txt | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_REPO: ${{ github.repository }} |
7f2d0dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preview