Repository navigation
69 lines (56 loc) · 1.78 KB
/
Copy pathplaywright.yml
File metadata and controls
69 lines (56 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Playwright End-to-End Tests
on:
pull_request:
branches: [ dev, main ]
workflow_dispatch:
permissions:
contents: write # Needed for deploying to GitHub Pages
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install SQLite3
run: sudo apt-get update && sudo apt-get install -y sqlite3 libsqlite3-dev
- name: Prepare test database
working-directory: sinatra
run: |
sqlite3 test/test_whoknows.db < schema_test.sql
sqlite3 test/test_whoknows.db < fts5.sql
sqlite3 test/test_whoknows.db "INSERT INTO pages_fts(rowid,content,language) SELECT rowid,content,language FROM pages;"
- name: Install Ruby & gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler-cache: true
working-directory: sinatra
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Playwright dependencies
working-directory: sinatra/tests
run: |
npm ci
npx playwright install --with-deps
- name: Run Playwright tests
working-directory: sinatra/tests
env:
WEATHERBIT_API_KEY: ${{ secrets.WEATHERBIT_API_KEY }}
run: npx playwright test --reporter=html
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: sinatra/tests/playwright-report
retention-days: 7
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sinatra/tests/playwright-report
publish_branch: gh-pages