Skip to content

Commit

Permalink
Update test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeIwaki committed Feb 19, 2024
1 parent 2dccc51 commit f989dbf
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 30 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ name: Deploy
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
push_to_rubygems:
name: Push to RubyGems
runs-on: ubuntu-latest
steps:
- name: Set RELEASE_TAG
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- name: Check Capybara::Playwright::VERSION
run: bundle exec ruby -e 'raise "invalid Capybara::Playwright::VERSION" unless Capybara::Playwright::VERSION == ENV["RELEASE_TAG"]'
- run: rake build
- name: setup API key
run: |
mkdir -p ~/.gem/
echo "---" > ~/.gem/credentials
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" >> ~/.gem/credentials
chmod 600 ~/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- run: gem push pkg/capybara-playwright-driver-$RELEASE_TAG.gem
- name: Set RELEASE_TAG
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Check Capybara::Playwright::VERSION
run: bundle exec ruby -e 'raise "invalid Capybara::Playwright::VERSION" unless Capybara::Playwright::VERSION == ENV["RELEASE_TAG"]'
- run: rake build
- name: setup API key
run: |
mkdir -p ~/.gem/
echo "---" > ~/.gem/credentials
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" >> ~/.gem/credentials
chmod 600 ~/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- run: gem push pkg/capybara-playwright-driver-$RELEASE_TAG.gem
50 changes: 40 additions & 10 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: RSpec
on: [pull_request]
jobs:
example_spec:
example_spec_legacy:
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.4.10
- 2.5.9
- 2.6.10
- '2.7'
- '3.0'
- '3.1'
- 2.7.8
name: (${{ matrix.ruby_version }}) Example
runs-on: ubuntu-latest
steps:
Expand All @@ -35,6 +33,38 @@ jobs:
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 3

example_spec:
strategy:
fail-fast: false
matrix:
ruby_version:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
name: (${{ matrix.ruby_version }}) Example
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: 20
- uses: microsoft/playwright-github-action@v1
- name: setup playwright via npm install
run: |
export PLAYWRIGHT_CLI_VERSION=$(bundle exec ruby -e 'require "playwright"; puts Playwright::COMPATIBLE_PLAYWRIGHT_VERSION.strip')
npm install playwright@${PLAYWRIGHT_CLI_VERSION} || npm install playwright@next
./node_modules/.bin/playwright install
- run: bundle exec rspec spec/feature/
env:
PLAYWRIGHT_CLI_EXECUTABLE_PATH: ./node_modules/.bin/playwright
timeout-minutes: 3

playwright_driver_spec:
needs: example_spec
strategy:
Expand All @@ -45,14 +75,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.3
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- uses: microsoft/playwright-github-action@v1
- name: setup playwright via npm install
run: |
Expand All @@ -71,19 +101,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: setup Allure
run: |
wget https://github.com/allure-framework/allure2/releases/download/2.14.0/allure_2.14.0-1_all.deb
sudo dpkg -i allure_2.14.0-1_all.deb
rm allure_2.14.0-1_all.deb
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.3
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- uses: microsoft/playwright-github-action@v1
- name: setup playwright via npm install
run: |
Expand Down

0 comments on commit f989dbf

Please sign in to comment.