feat: use playwright test suit #200
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: CI Check | |
on: | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
branches: | |
- main | |
jobs: | |
ci-check: | |
name: CI Check | |
runs-on: ubuntu-latest | |
container: | |
image: mcr.microsoft.com/playwright:v1.45.1-jammy | |
options: --user 1001 | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.IDEALJS_BOT_APP_ID }} | |
private_key: ${{ secrets.IDEALJS_BOT_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install Dependencies | |
run: yarn install --immutable | |
- name: Update Playwright Snapshot | |
run: yarn workspace website test | |
update-snapshot: | |
needs: [ci-check] | |
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }} | |
name: Update Snapshot | |
environment: | |
name: snapshot-updater | |
runs-on: ubuntu-latest | |
container: | |
image: mcr.microsoft.com/playwright:v1.45.1-jammy | |
options: --user 1001 | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.IDEALJS_BOT_APP_ID }} | |
private_key: ${{ secrets.IDEALJS_BOT_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install Dependencies | |
run: yarn install --immutable | |
- name: Update Playwright Snapshot | |
run: yarn workspace website test -u | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: update image snapshot" |