Something went wrong. Try again.
Pop-up dictionary browser extension for language learning. Successor to Yomichan. (PERSONAL FORK)
Something went wrong. Try again.
YAML
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200name: Playwright Testson: push: branches: [master] pull_request:permissions: contents: readjobs: playwright-tests: timeout-minutes: 60 runs-on: ubuntu-latest strategy: fail-fast: false matrix: shardIndex: [1, 2, 3, 4, 5] shardTotal: [5] steps: - name: Remove all fonts run: rm -rf /usr/share/fonts
- uses: actions/checkout@v6
- name: Install CJK fonts uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3 with: packages: fonts-ipafont-mincho execute_install_scripts: true
- uses: ./.github/actions/setup
- name: Build run: npm run build
- name: Cache playwright browsers id: cache-playwright uses: actions/cache@v4 with: path: | ~/.cache/ms-playwright key: cache-playwright-${{ hashFiles('package-lock.json') }} # playwright version is included in package-lock, so this serves as a reasonable cache key
- if: ${{ steps.cache-playwright.outputs.cache-hit != 'true' }} name: Install Playwright Browsers run: npx playwright install chromium
- name: Grab latest dictionaries from dictionaries branch uses: actions/checkout@v6 with: repository: yomidevs/yomitan # so that this works on forks ref: dictionaries path: dictionaries
### [PR] master-screenshots
- name: "[PR] Grab latest screenshots from master branch" uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # pin@v2 continue-on-error: true id: master-screenshots with: github_token: ${{ secrets.GITHUB_TOKEN }} repo: yomidevs/yomitan # so that this works on forks name: playwright-screenshots branch: master workflow: playwright.yml workflow_conclusion: success path: test/playwright/__screenshots__/ if: github.event_name == 'pull_request'
- name: "[PR] Store steps.master-screenshots.outcome in a file" run: echo ${{ steps.master-screenshots.outcome }} > ./master-screenshots-outcome if: github.event_name == 'pull_request'
- name: "[PR] Upload master-screenshots-outcome" uses: actions/upload-artifact@v6 with: name: master-screenshots-outcome-${{ matrix.shardIndex }} path: master-screenshots-outcome if: github.event_name == 'pull_request'
### actual tests - name: "[PR] Run tests & compare against master" id: playwright run: | npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} 2>&1 | tee ./playwright-output || true continue-on-error: true if: github.event_name == 'pull_request' && steps.master-screenshots.outcome != 'failure'
- name: "[Push] Run tests & save screenshots" id: playwright-master run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} -u 2>&1 | tee ./playwright-output if: github.event_name == 'push'
- uses: actions/upload-artifact@v6 with: name: playwright-screenshots-${{ matrix.shardIndex }} path: test/playwright/__screenshots__/ retention-days: 1
- name: Upload blob report to GitHub Actions Artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v6 with: name: blob-report-${{ matrix.shardIndex }} path: blob-report retention-days: 1
- uses: actions/upload-artifact@v6 with: name: playwright-output-${{ matrix.shardIndex }} path: playwright-output retention-days: 1
playwright: timeout-minutes: 60 runs-on: ubuntu-latest # Merge reports after playwright-tests, even if some shards have failed if: ${{ !cancelled() }} needs: [playwright-tests] steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup
### playwright-report - name: Download blob reports from GitHub Actions Artifacts uses: actions/download-artifact@v7 with: path: all-blob-reports pattern: blob-report-* merge-multiple: true
- name: Merge into HTML Report run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Merge into JSON Report run: npx playwright merge-reports --reporter json ./all-blob-reports > playwright-results.json
- uses: actions/upload-artifact@v6 with: name: playwright-report path: playwright-report/
- uses: actions/upload-artifact@v6 with: name: playwright-results-json path: playwright-results.json
### playwright-screenshots - name: Download & merge screenshots from GitHub Actions Artifacts uses: actions/download-artifact@v7 with: path: test/playwright/__screenshots__ pattern: playwright-screenshots-* merge-multiple: true
- uses: actions/upload-artifact@v6 with: name: playwright-screenshots path: test/playwright/__screenshots__/
### [PR] master-screenshots-outcome - name: '[PR] Download master-screenshots-outcome files' uses: actions/download-artifact@v7 with: path: master-screenshots-outcomes pattern: master-screenshots-outcome-* merge-multiple: true if: github.event_name == 'pull_request'
- name: '[PR] Calculate if any shard failed to download master screenshots' run: | if grep -q "failure" master-screenshots-outcomes/*; then echo "failure" > master-screenshots-outcome else echo "success" > master-screenshots-outcome fi if: github.event_name == 'pull_request'
- name: '[PR] Upload master-screenshots-outcome' uses: actions/upload-artifact@v6 with: name: master-screenshots-outcome path: master-screenshots-outcome if: github.event_name == 'pull_request'
### playwright-output - name: Download playwright-output files uses: actions/download-artifact@v7 with: path: playwright-outputs pattern: playwright-output-* merge-multiple: true
- name: Merge playwright output files run: cat playwright-outputs/* > playwright-output
- uses: actions/upload-artifact@v6 with: name: playwright-output path: playwright-output