Skip to content

Commit

Permalink
Install ffmpeg on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeIwaki committed Feb 2, 2025
1 parent 6bdd883 commit 5f79c20
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 69 deletions.
135 changes: 68 additions & 67 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ on:
paths-ignore:
- development/generate_api/example_codes.rb
- development/unimplemented_examples.md
- 'documentation/**'
- "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
- 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
- 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]
Expand All @@ -47,30 +47,31 @@ jobs:
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
- 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
sudo apt-get install -y ffmpeg
- 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]
Expand All @@ -81,27 +82,27 @@ jobs:
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
- 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
3 changes: 1 addition & 2 deletions spec/integration/screencast_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
require 'open3'
require 'tmpdir'

# https://github.com/microsoft/playwright/blob/master/tests/screencast.spec.ts
# https://github.com/microsoft/playwright-python/blob/master/tests/async/test_video.py
# https://github.com/microsoft/playwright/blob/main/tests/library/video.spec.ts
RSpec.describe 'screencast' do
def most_frequest_color_in_last_frame(dir, video_file)
_, stderr, status = Open3.capture3("ffmpeg -i #{video_file} -r 25 #{video_file}-%03d.png", chdir: dir)
Expand Down

0 comments on commit 5f79c20

Please sign in to comment.