Repository navigation
Skip expensive test setup for documentation-only changes #186
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
| --- | |
| name: MongoDB | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: mongodb-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| uses: ./.github/workflows/test-changes.yml | |
| test: | |
| needs: changes | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| env: | |
| DATABASE_ADAPTER: mongoid | |
| MONGOID_VERSION: ${{ matrix.entry.mongoid }} | |
| GRAPE_VERSION: ${{ matrix.entry.grape || '>= 0' }} | |
| JSON_VERSION: ${{ matrix.entry.json }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| entry: | |
| # These Active Support versions pass quirks_mode, removed in JSON 3. | |
| - { ruby: '3.2', mongoid: '6.4.8', mongodb: '4.4', json: '~> 2.0' } | |
| - { ruby: '3.2', mongoid: '7.2.3', mongodb: '4.4', json: '~> 2.0' } | |
| - { ruby: '3.2', mongoid: '7.3.0', mongodb: '4.4', json: '~> 2.0' } | |
| - { ruby: '3.3', mongoid: '7.3.0', mongodb: '5.0', json: '~> 2.0' } | |
| - { ruby: '3.4', mongoid: '7.5.2', mongodb: '5.0', json: '~> 2.0' } | |
| - { ruby: '3.4', mongoid: '8.1.11', mongodb: '6.0', json: '~> 2.0' } | |
| - { ruby: '3.4', mongoid: '8.1.11', mongodb: '7.0', json: '~> 2.0' } | |
| - { ruby: '3.4', mongoid: '8.1.11', mongodb: '8.0', json: '~> 2.0' } | |
| - { ruby: '3.3', mongoid: '~> 9.1', mongodb: '8.0', grape: '~> 3.2', json: '~> 3.0' } | |
| - { ruby: '3.4', mongoid: '~> 9.1', mongodb: '8.0', grape: '~> 4.0', json: '~> 3.0' } | |
| - { ruby: '4.0', mongoid: '~> 9.1', mongodb: '8.0', grape: '~> 4.0', json: '~> 3.0' } | |
| name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }}, grape=${{ matrix.entry.grape || 'auto' }}, json=${{ matrix.entry.json }}) | |
| services: | |
| mongodb: | |
| image: ${{ needs.changes.outputs.run_tests == 'true' && format('mongo:{0}', matrix.entry.mongodb) || '' }} | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --quiet --eval 'db.adminCommand({ ping: 1 })' || mongo --quiet --eval 'db.adminCommand({ ping: 1 })'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| if: needs.changes.outputs.run_tests == 'true' | |
| - uses: ruby/setup-ruby@v1 | |
| if: needs.changes.outputs.run_tests == 'true' | |
| with: | |
| ruby-version: ${{ matrix.entry.ruby }} | |
| bundler-cache: true | |
| cache-version: mongoid-${{ matrix.entry.mongoid }}-grape-${{ matrix.entry.grape || 'auto' }}-json-${{ matrix.entry.json }} | |
| - uses: browser-actions/setup-firefox@v1.7.2 | |
| if: needs.changes.outputs.run_tests == 'true' | |
| with: | |
| firefox-version: latest | |
| - name: Test | |
| if: needs.changes.outputs.run_tests == 'true' | |
| run: xvfb-run --auto-servernum bundle exec rake spec | |
| - name: Documentation only | |
| if: needs.changes.outputs.run_tests == 'false' | |
| run: echo 'Documentation-only change; database, dependencies, browser, and tests skipped.' |