name: Tests on: [push] jobs: test: if: "!contains(github.event.head_commit.message, '[skip-tests]')" runs-on: ubuntu-latest strategy: matrix: rails-version: ["7.1", "7.2", "8.0"] services: postgres: image: postgres:17 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - 5432:5432 steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 3.3 bundler-cache: true - name: Install dependencies working-directory: feature-app env: RAILS_TEST_VERSION: ${{ matrix.rails-version }} run: | bundle install bundle exec appraisal install - name: Set up database working-directory: feature-app env: RAILS_TEST_VERSION: ${{ matrix.rails-version }} run: | cp config/database.yml.ci config/database.yml RAILS_ENV=test bundle exec rails db:create RAILS_ENV=test bundle exec rails db:migrate - name: Precompile assets working-directory: feature-app env: RAILS_TEST_VERSION: ${{ matrix.rails-version }} run: RAILS_ENV=test bundle exec rails assets:precompile - name: Run RSpec tests working-directory: feature-app env: RAILS_TEST_VERSION: ${{ matrix.rails-version }} run: bundle exec appraisal rails-${{ matrix.rails-version }} rspec