|
| 1 | +--- |
| 2 | +name: Specs Rails 7.1 Postgres |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: [main] |
| 7 | + push: |
| 8 | + branches: [main] |
| 9 | + |
| 10 | +jobs: |
| 11 | + tests: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + ruby: ['3.0', '3.1', '3.2'] |
| 17 | + gemfile: ['rails_7_1_postgres'] |
| 18 | + |
| 19 | + env: |
| 20 | + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile |
| 21 | + DB_TEST: postgres |
| 22 | + PG_DB_HOST: 127.0.0.1 |
| 23 | + PG_DB_USERNAME: postgres |
| 24 | + PG_DB_PASSWORD: postgres |
| 25 | + RAILS: '7.0' |
| 26 | + |
| 27 | + services: |
| 28 | + postgres: |
| 29 | + image: postgres:latest |
| 30 | + env: |
| 31 | + POSTGRES_USER: postgres |
| 32 | + POSTGRES_PASSWORD: postgres |
| 33 | + options: >- |
| 34 | + --health-cmd pg_isready |
| 35 | + --health-interval 10s |
| 36 | + --health-timeout 5s |
| 37 | + --health-retries 5 |
| 38 | + ports: |
| 39 | + - 5432:5432 |
| 40 | + |
| 41 | + steps: |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@v2 |
| 44 | + |
| 45 | + - name: Set up Ruby |
| 46 | + uses: ruby/setup-ruby@v1 |
| 47 | + with: |
| 48 | + ruby-version: ${{ matrix.ruby }} |
| 49 | + bundler-cache: true |
| 50 | + |
| 51 | + - name: Create database |
| 52 | + run: bundle exec rails db:create |
| 53 | + |
| 54 | + - name: Apply migrations |
| 55 | + run: bundle exec rails db:migrate |
| 56 | + |
| 57 | + - name: Run tests |
| 58 | + run: bundle exec rspec --profile |
| 59 | + |
| 60 | + - name: Code Climate test coverage |
| 61 | + uses: paambaati/codeclimate-action@v3.0.0 |
| 62 | + env: |
| 63 | + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
| 64 | + with: |
| 65 | + coverageLocations: | |
| 66 | + ${{github.workspace}}/coverage/lcov/active_storage_db.lcov:lcov |
| 67 | +
|
| 68 | + # - name: Upload coverage results |
| 69 | + # uses: actions/upload-artifact@main |
| 70 | + # if: always() |
| 71 | + # with: |
| 72 | + # name: coverage-report |
| 73 | + # path: coverage/index.html |
0 commit comments