feat: add playwright #2
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: Update test-results | |
on: | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update-test-results: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: oven-sh/setup-bun@v1 | |
- name: Extract branch name | |
id: extract_branch | |
run: | | |
echo "branch=${{ github.head_ref }}" >> $GITHUB_ENV | |
- name: Checkout to branch | |
run: | | |
git checkout ${{ env.branch }} | |
git config --global url."https://${{ secrets.BLOG_TOKEN }}:[email protected]/".insteadOf "https://github.com/" | |
- name: Check diff | |
id: diff | |
run: | | |
git add -N . | |
git diff --name-only --exit-code test-results/ | |
continue-on-error: true | |
- name: Commit & Push | |
run: | | |
set -x | |
bun install | |
bun run dev | |
bunx playwright test | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
git add . | |
git commit -m 'chore: update test-results' --allow-empty | |
git push origin ${{ env.branch }} | |
env: | |
GH_TOKEN: ${{ secrets.BLOG_TOKEN }} |