@@ -11,19 +11,20 @@ jobs:
1111 matrix :
1212 include :
1313 - ruby : ' 3.4.4'
14- rails : ' 7.1.5.1 '
14+ rails : ' 7.1.5.2 '
1515 allowed_failure : false # ✅ required
16- # - ruby: '3.4.4'
17- # rails: '7.2'
18- # allowed_failure: true # ⚠️ allowed to fail
1916 - ruby : ' 3.4.4'
20- rails : ' 8.0'
17+ rails : ' 7.2.2.1'
18+ allowed_failure : false # ⚠️ allowed to fail
19+ - ruby : ' 3.4.4'
20+ rails : ' 8.0.2'
2121 allowed_failure : true # ⚠️ allowed to fail
2222
2323 env :
2424 RAILS_ENV : test
2525 DATABASE_URL : " postgis://rails:password@localhost:5432/rails_test"
2626 ES_HOST : " http://localhost"
27+ ELASTICSEARCH_URL : " http://localhost:9200"
2728 RAILS_VERSION : ${{ matrix.rails }}
2829
2930 services :
@@ -54,15 +55,15 @@ jobs:
5455 # Run the automatic bundle-install only on 7.1.
5556 # For 7.2 / 8.0 it just sets up Ruby *and* restores a cache layer
5657 # that we’ll reuse in the later manual install.
57- bundler-cache : ${{ matrix.rails == '7.1.5.1 ' }}
58+ bundler-cache : ${{ matrix.rails == '7.1.5.2 ' }}
5859
5960 # One cache bucket per Rails version so they don’t clobber each other.
6061 cache-version : rails-${{ matrix.rails }}
6162
6263 # Updating Rails can legitimately blow up on the experimental tracks,
6364 # so we allow that *step* to error out without failing the job.
6465 - name : Update Rails & install gems
65- if : matrix.rails != '7.1.5.1 '
66+ if : matrix.rails != '7.1.5.2 '
6667 id : update
6768 run : |
6869 # turn off deployment mode
@@ -74,21 +75,52 @@ jobs:
7475 continue-on-error : ${{ matrix.allowed_failure }}
7576
7677 - name : Prepare DB schema
77- if : (matrix.rails == '7.1.5.1 ') || steps.update.outcome == 'success'
78+ if : (matrix.rails == '7.1.5.2 ') || steps.update.outcome == 'success'
7879 run : |
7980 rm -f spec/dummy/tmp/pids/server.pid
8081 bundle exec rake -f spec/dummy/Rakefile db:schema:load
8182 continue-on-error : ${{ matrix.allowed_failure }}
8283
84+ - name : Wait for Elasticsearch
85+ if : (matrix.rails == '7.1.5.2') || steps.update.outcome == 'success'
86+ run : |
87+ echo "Waiting for Elasticsearch to be healthy..."
88+ curl -s "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" || (echo "Elasticsearch not healthy" && exit 1)
89+
90+
8391 - name : Run RSpec
84- if : (matrix.rails == '7.1.5.1 ') || steps.update.outcome == 'success'
92+ if : (matrix.rails == '7.1.5.2 ') || steps.update.outcome == 'success'
8593 env :
8694 RAILS_MASTER_KEY : ${{ secrets.RAILS_MASTER_KEY }}
8795 run : |
8896 rm -f spec/dummy/tmp/pids/server.pid
8997 bundle exec rspec
9098 continue-on-error : ${{ matrix.allowed_failure }}
9199
100+ - name : Upload coverage report
101+ if : always()
102+ uses : actions/upload-artifact@v4
103+ with :
104+ name : coverage-report-ruby-${{ matrix.ruby }}-rails-${{ matrix.rails }}
105+ path : |
106+ coverage/
107+
108+ - name : Generate coverage badge
109+ if : ${{ github.ref == 'refs/heads/main' && success() }}
110+ continue-on-error : true
111+ run : |
112+ COVERAGE=$(jq -r '.result.covered_percent' coverage/.last_run.json)
113+ COLOR=$(node -e "cov=parseFloat(process.argv[1]);console.log(cov>=90?'green':cov>=75?'orange':'red')" $COVERAGE)
114+ npx badgen-cli --subject coverage --status ${COVERAGE}% --color $COLOR > coverage.svg
115+
116+ - name : Commit badge
117+ if : ${{ github.ref == 'refs/heads/main' && success() }}
118+ continue-on-error : true
119+ uses : stefanzweifel/git-auto-commit-action@v5
120+ with :
121+ commit_message : " chore: update coverage badge"
122+ file_pattern : coverage.svg
123+
92124 # ── style & security jobs (unchanged) ───────────────────────────────────────
93125 rubocop :
94126 runs-on : ubuntu-latest
0 commit comments