-
Notifications
You must be signed in to change notification settings - Fork 37
107 lines (102 loc) · 3.42 KB
/
rspec.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: RSpec
on:
pull_request:
paths-ignore:
- development/generate_api/example_codes.rb
- development/unimplemented_examples.md
- 'documentation/**'
- spec/integration/example_spec.rb
jobs:
unit_test:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- run: |
rm -rf spec/integration
bundle exec rspec
generate_playwright_api:
name: Generate Playwright API codes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- run: bundle exec ruby development/generate_api.rb
- uses: actions/upload-artifact@v4
with:
name: playwright_api
path: lib/playwright_api
integration_test_with_npm_playwright_driver:
needs: [unit_test, generate_playwright_api]
strategy:
fail-fast: false
matrix:
ruby_version: [2.7, 3.0, 3.1, 3.2]
browser: [chromium, webkit]
name: (${{ matrix.browser }}/Ruby${{ matrix.ruby_version }}) Integration test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: 16
- name: setup ${{ matrix.version }} playwright via npm install
run: |
export PLAYWRIGHT_CLI_VERSION=$(bundle exec ruby -e 'puts Playwright::COMPATIBLE_PLAYWRIGHT_VERSION.strip')
npm install playwright@${PLAYWRIGHT_CLI_VERSION} || npm install playwright@next
./node_modules/.bin/playwright install ${{ matrix.browser }}
./node_modules/.bin/playwright install-deps
- name: Download playwright_api codes
uses: actions/download-artifact@v4
with:
name: playwright_api
path: lib/playwright_api
- run: bundle exec rspec spec/integration --profile 10
env:
BROWSER: ${{ matrix.browser }}
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 25
integration_test_with_npm_playwright_driver_and_old_ruby:
needs: [unit_test, generate_playwright_api]
strategy:
fail-fast: false
matrix:
ruby_version: [2.4, 2.5, 2.6]
name: (chromium/Ruby${{ matrix.ruby_version }}) example_spec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: 16
- name: setup ${{ matrix.version }} playwright via npm install
run: |
export PLAYWRIGHT_CLI_VERSION=$(bundle exec ruby -e 'puts Playwright::COMPATIBLE_PLAYWRIGHT_VERSION.strip')
npm install playwright@${PLAYWRIGHT_CLI_VERSION} || npm install playwright@next
./node_modules/.bin/playwright install chromium
./node_modules/.bin/playwright install-deps
- name: Download playwright_api codes
uses: actions/download-artifact@v4
with:
name: playwright_api
path: lib/playwright_api
- run: bundle exec rspec spec/integration/example_spec.rb
env:
BROWSER: chromium
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 10