Skip to content

Updated to Rails 7 & Ruby 3.1 #1949

Updated to Rails 7 & Ruby 3.1

Updated to Rails 7 & Ruby 3.1 #1949

Workflow file for this run

name: Tests - MySQL
on: [pull_request]
jobs:
mysql:
runs-on: ubuntu-20.04
# Define environment variables for MySQL and Rails
env:
DB_ADAPTER: mysql2
MYSQL_PWD: root
RAILS_ENV: test
steps:
# Checkout the repo
- uses: actions/checkout@v3
# Install Ruby and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
# Install Node
- uses: actions/setup-node@v3
with:
node-version: '16.6.0'
cache: 'yarn'
node-version: 16

Check failure on line 30 in .github/workflows/mysql.yml

View workflow run for this annotation

GitHub Actions / Tests - MySQL

Invalid workflow file

The workflow is not valid. .github/workflows/mysql.yml (Line: 30, Col: 9): 'node-version' is already defined
# Copy all of the example configs over
- name: 'Setup the application'
run: |
cp config/database.yml.sample config/database.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
cp .env.mysql2 .env
# Stub out the Rails credentials file so that we can start the Rails app
- name: 'Setup Credentials'
run: EDITOR='echo "$(cat config/credentials.yml.mysql2)" >' bundle exec rails credentials:edit
# Set the path to the wkhtmltopdf executable
- name: 'Determine wkhtmltopdf location'
run: echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV
# Run yarn install for JS dependencies
- name: 'Yarn Install'
run: yarn install
# Start the DB server and initialize the DB
- name: 'Start MySQL'
run: sudo systemctl start mysql
- name: 'Build out the test database'
run: |
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:schema:load RAILS_ENV=test
- name: 'Run any pending database migrations'
run: bin/rails db:migrate RAILS_ENV=test
# Prebuild the CSS, JS and image assets
- name: 'Precompile all of the Assets'
run: bundle exec rails assets:precompile
# Run the unit and functional tests
- name: 'Run Rspec Unit and Functional Tests'
run: |
bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bundle exec rspec spec/mixins/
# Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Rspec Integration Tests'
run: bundle exec rspec spec/features/