2222 continue-on-error : ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
2323 steps :
2424
25- - uses : actions/checkout@v4
25+ - uses : actions/checkout@v5
2626 - uses : ruby/setup-ruby@v1
2727 with :
2828 ruby-version : ${{ matrix.ruby }}
3434 bundle env
3535 head -n1 $(which bundle)
3636
37- - name : Set ENV for codeclimate (pull_request)
38- run : |
39- git fetch --no-tags --prune --depth=1 origin +refs/heads/$GITHUB_HEAD_REF:refs/remotes/origin/$GITHUB_HEAD_REF
40- echo "GIT_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
41- echo "GIT_COMMIT_SHA=$(git rev-parse origin/$GITHUB_HEAD_REF)" >> $GITHUB_ENV
42- if : github.event_name == 'pull_request'
43-
44- - name : Set ENV for codeclimate (push)
45- run : |
46- echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
47- echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
48- if : github.event_name == 'push'
49-
50- - name : Prepare CodeClimate
51- env :
52- CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
53- run : |
54- curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter;
55- chmod +x ./cc-test-reporter
56- ./cc-test-reporter before-build
57-
58- - name : Run Tests
37+ - name : Run Tests & generate coverage
5938 env :
6039 PG_DATABASE : postgres
6140 PG_HOST : localhost
@@ -69,40 +48,17 @@ jobs:
6948 cp config/database-travis.yml config/database.yml
7049 bundle exec rake db:setup
7150 bundle exec rails test test/*
72- - name : Save coverage
73- run : ./cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.ruby }}.json
74-
75- - uses : actions/upload-artifact@v4.6.0
76- with :
77- name : coverage-${{ matrix.ruby }}
78- path : coverage/codeclimate.${{ matrix.ruby }}.json
7951
80- upload_coverage :
81- strategy :
82- fail-fast : false
83- matrix :
84- ruby : [ '3.0.3' ]
85- runs-on : ubuntu-24.04
86-
87- env :
88- CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
89- CC_TEST_REPORTER_URL : https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
90-
91- needs : test
92-
93- steps :
94- - name : Download test coverage reporter
95- run : curl -L $CC_TEST_REPORTER_URL > cc-test-reporter
96-
97- - name : Give test coverage reporter executable permissions
98- run : chmod +x cc-test-reporter
99-
100- - uses : actions/download-artifact@v4.1.8
101- with :
102- name : coverage-${{ matrix.ruby }}
103- path : coverage
52+ # ------------------------------
53+ # Qlty.sh integration
54+ # ------------------------------
55+ - name : Install qlty CLI
56+ run : |
57+ curl -LSs https://qlty.sh | bash
58+ echo "${HOME}/.qlty/bin" >> $GITHUB_PATH
10459
105- - name : Aggregate & upload results to Code Climate
60+ - name : Upload coverage to Qlty
61+ env :
62+ QLTY_COVERAGE_TOKEN : ${{ secrets.QLTY_COVERAGE_TOKEN }}
10663 run : |
107- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 1
108- ./cc-test-reporter upload-coverage -r ${{ secrets.CC_TEST_REPORTER_ID }}
64+ qlty coverage publish --report-format=simplecov coverage/.resultset.json
0 commit comments