Target Rails 7.2 #51
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | |
| # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | |
| name: build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: "*" | |
| jobs: | |
| style: | |
| name: Styles (Standard) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.1" | |
| bundler-cache: true | |
| - run: bundle exec standardrb --format github | |
| test: | |
| name: Tests (Spectacles) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: [3.1, head, jruby-head] | |
| continue-on-error: ${{ endsWith(matrix.ruby-version, 'head') || matrix.ruby-version == 'debug' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true | |
| - run: bundle exec rake test:spectacles | |
| test-mysql: | |
| name: Tests (MySQL) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: [3.1, head, jruby-head] | |
| continue-on-error: ${{ endsWith(matrix.ruby-version, 'head') || matrix.ruby-version == 'debug' }} | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| ports: | |
| - 3306 | |
| env: | |
| JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M" | |
| MYSQL_USER: root | |
| MYSQL_PASSWORD: root | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: Setup database | |
| run: | | |
| sudo service mysql start | |
| - name: Run tests | |
| run: | | |
| bundle exec rake test:mysql2 | |
| test-pgsql: | |
| name: Tests (Postgres) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: [3.1, head, jruby-head] | |
| continue-on-error: ${{ endsWith(matrix.ruby-version, 'head') || matrix.ruby-version == 'debug' }} | |
| services: | |
| postgres: | |
| image: postgres:11 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| env: | |
| JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M" | |
| PGHOST: localhost | |
| PGPORT: 5432 | |
| PGUSER: postgres | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: Setup database | |
| env: | |
| PGPASSWORD: postgres | |
| run: | | |
| createdb spectacles_test | |
| - name: Run tests | |
| run: | | |
| bundle exec rake test:postgresql | |
| test-sqlite: | |
| name: Tests (SQLite) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: [3.1, head, jruby-head] | |
| continue-on-error: ${{ endsWith(matrix.ruby-version, 'head') || matrix.ruby-version == 'debug' }} | |
| env: | |
| JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: Run tests | |
| run: | | |
| bundle exec rake test:sqlite3 |