name: "Running Tests" on: - pull_request env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: test: strategy: fail-fast: false matrix: # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' ruby: ['2.7', '3.0', '3.1', 'head'] runs-on: ubuntu-latest services: postgres: image: postgres:11.6 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: "" POSTGRES_DB: postgres ports: ["5432:5432"] options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 env: RAILS_ENV: test PGHOST: localhost PGUSER: postgres steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} # runs 'bundle install' and caches installed gems automatically bundler-cache: true - name: Create a database run: rake db:create - name: Install citext extension run: | psql -U postgres -d "acts-as-taggable-array-on_test" -c "CREATE EXTENSION IF NOT EXISTS citext;" - name: Running a test run: bundle exec rspec