Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/brakeman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
brakeman:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on: [push, pull_request]

jobs:
danger:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3

- name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
run: |
echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`" >> $GITHUB_ENV
echo "RUBY_VERSION=`cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+'`" >> $GITHUB_ENV
echo "BUNDLER_VERSION=`cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+'`" >> $GITHUB_ENV

# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
eslint:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
# Checkout the repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
mysql:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

# Define environment variables for MySQL and Rails
env:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
postgresql:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

services:
# Postgres installation
Expand Down Expand Up @@ -52,6 +52,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libpq-dev

# Install ImageMagick (for `identify` command)
- name: 'Install ImageMagick'
run: |
sudo apt-get install -y imagemagick

# Copy all of the example configs over
- name: 'Setup Default Configuration'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
rubocop:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
# Checkout the repo
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fixed bar chart click function in the Usage dashboard (GitHub issue #3443)
- Fixed broken link for the V1 API documentation.
- Fix `hidden_field_tag` Nested Attributes Format For Rails 7 Upgrade and Add Test Coverage [#3479](https://github.com/DMPRoadmap/roadmap/pull/3479)
- Update all workflows to `runs-on: ubuntu-24.04` and Consolidate Capybara Config [#3487](https://github.com/DMPRoadmap/roadmap/pull/3487)
- Add pdf handling in `render_respond_to_format_with_error_message` [#3482](https://github.com/DMPRoadmap/roadmap/pull/3482)
- Lower PostgreSQL GitHub Action Chrome Version to Address Breaking Changes Between Latest Chrome Version (134) and `/features` Tests [#3491](https://github.com/DMPRoadmap/roadmap/pull/3491)

Expand Down
18 changes: 0 additions & 18 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,3 @@
config.include Devise::Test::ControllerHelpers, type: :view
config.include Pundit::Matchers, type: :policy
end

Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')

Capybara::Selenium::Driver.new(
app,
browser: :chrome,
options: options
)
end

Capybara.javascript_driver = :headless_chrome
Capybara.default_driver = :headless_chrome
# Configure Capybara to wait longer for elements to appear
Capybara.default_max_wait_time = 20
18 changes: 11 additions & 7 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@
# Use Puma as the webserver for feature tests
Capybara.server = :puma, { Silent: true }

# Use the fast rack_test driver for non-feature tests by default
Capybara.default_driver = :rack_test

# Create a custom driver based on Capybara's :selenium_chrome_headless driver
# This resolves a ElementClickInterceptedError when executing `click_button 'Sign in'` with DMP Assistant
Capybara.register_driver :selenium_chrome_headless_add_window_size do |app|
Capybara.register_driver :selenium_chrome_headless_custom do |app|
# Get a copy of the default options for Capybara's :selenium_chrome_headless driver
options = Capybara.drivers[:selenium_chrome_headless].call.options[:options].dup
options.add_argument('--window-size=1920,1080') # default window-size is only (800x600)
# Resolves ElementClickInterceptedError (default window-size is only (800x600))
options.add_argument('--window-size=1920,1080')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# Create a new Selenium driver with the customised options
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end

# Use the fast rack_test driver for non-feature tests by default
Capybara.default_driver = :rack_test
Capybara.javascript_driver = :selenium_chrome_headless_custom
Capybara.default_max_wait_time = 20

RSpec.configure do |config|
config.before(:each, type: :feature, js: false) do
Capybara.use_default_driver
end

# Use the Selenium headless Chrome driver for feature tests
config.before(:each, type: :feature, js: true) do
Capybara.current_driver = :selenium_chrome_headless_add_window_size
Capybara.current_driver = :selenium_chrome_headless_custom
end
end