2121 runs-on : ${{ matrix.os }}
2222 continue-on-error : ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
2323 steps :
24- - uses : actions/checkout@v4
24+ - uses : actions/checkout@v5
2525
2626 - name : Set up Ruby
2727 uses : ruby/setup-ruby@v1
@@ -32,31 +32,10 @@ jobs:
3232 - name : Config bundler
3333 run : |
3434 bundle config set without 'development staging production'
35- bundle config set deployment '[secure] '
35+ bundle config set deployment 'true '
3636 bundle env
3737 head -n1 $(which bundle)
3838
39- - name : Set ENV for codeclimate (pull_request)
40- run : |
41- git fetch --no-tags --prune --depth=1 origin +refs/heads/$GITHUB_HEAD_REF:refs/remotes/origin/$GITHUB_HEAD_REF
42- echo "GIT_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
43- echo "GIT_COMMIT_SHA=$(git rev-parse origin/$GITHUB_HEAD_REF)" >> $GITHUB_ENV
44- if : github.event_name == 'pull_request'
45-
46- - name : Set ENV for codeclimate (push)
47- run : |
48- echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
49- echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
50- if : github.event_name == 'push'
51-
52- - name : Prepare CodeClimate
53- env :
54- CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
55- run : |
56- curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter;
57- chmod +x ./cc-test-reporter
58- ./cc-test-reporter before-build
59-
6039 - name : Run Tests
6140 env :
6241 PG_DATABASE : postgres
@@ -67,58 +46,50 @@ jobs:
6746 RAILS_ENV : test
6847 COVERAGE : true
6948 DISABLE_SPRING : 1
70- CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
7149 run : |
7250 cp config/application.yml.sample config/application.yml
7351 bundle exec rake db:setup
7452 bundle exec rails assets:precompile
7553 bundle exec rspec
7654
7755 - name : Upload Capybara screenshots
78- if : failure()
56+ if : failure() && hashFiles('tmp/capybara/**') != ''
7957 uses : actions/upload-artifact@v4.6.2
8058 with :
8159 name : capybara-screenshots
8260 path : tmp/capybara
8361
84- - name : Save coverage
85- run : ./cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.ruby }}.json
86-
87- - uses : actions/upload-artifact@v4.6.2
88- with :
89- name : coverage-${{ matrix.ruby }}
90- path : coverage/codeclimate.${{ matrix.ruby }}.json
91-
92- upload_coverage :
93- strategy :
94- fail-fast : false
95- matrix :
96- os : [ ubuntu-24.04 ]
97- ruby : [ '3.4.4' ]
98- runs-on : ubuntu-24.04
99-
100- env :
101- CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
102- CC_TEST_REPORTER_URL : https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
103-
104- needs : test
105-
106- steps :
107- - name : Download test coverage reporter
108- run : curl -L $CC_TEST_REPORTER_URL > cc-test-reporter
109-
110- - name : Give test coverage reporter executable permissions
111- run : chmod +x cc-test-reporter
112-
113- - uses : actions/download-artifact@v4.3.0
114- with :
115- name : coverage-${{ matrix.ruby }}
116- path : coverage
62+ - name : Install qlty CLI
63+ run : |
64+ curl -LSs https://qlty.sh | bash
65+ echo "${HOME}/.qlty/bin" >> $GITHUB_PATH
11766
118- - name : Aggregate & upload results to Code Climate
67+ - name : Upload coverage to Qlty
68+ env :
69+ QLTY_COVERAGE_TOKEN : ${{ secrets.QLTY_COVERAGE_TOKEN }}
11970 run : |
120- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json
121- ./cc-test-reporter upload-coverage
71+ if [ -d "coverage" ]; then
72+ echo "Coverage directory found:"
73+ ls -la coverage/
74+ if [ -f "coverage/lcov.info" ]; then
75+ echo "Found LCOV info file, uploading to qlty..."
76+ qlty coverage publish --format=lcov coverage/lcov.info
77+ elif [ -d "coverage/lcov" ]; then
78+ echo "Found LCOV directory, combining files..."
79+ cat coverage/lcov/*.lcov > coverage/coverage.lcov
80+ qlty coverage publish --format=lcov coverage/coverage.lcov
81+ elif [ -f "coverage/coverage.lcov" ]; then
82+ qlty coverage publish --format=lcov coverage/coverage.lcov
83+ else
84+ echo "No LCOV coverage file found. Available files:"
85+ find coverage/ -type f -name "*.lcov" -o -name "*.info" -o -name "*.json" -o -name "*.xml"
86+ echo "Please check what coverage format your test runner generates"
87+ exit 1
88+ fi
89+ else
90+ echo "No coverage directory found. Skipping coverage upload."
91+ echo "This is normal if coverage is not configured or tests failed."
92+ fi
12293
12394 security_scan :
12495 runs-on : ubuntu-24.04
12798 matrix :
12899 ruby : ['3.4.4']
129100 steps :
130- - uses : actions/checkout@v4
101+ - uses : actions/checkout@v5
131102 - name : Set up Ruby
132103 uses : ruby/setup-ruby@v1
133104 with :
@@ -136,7 +107,7 @@ jobs:
136107 - name : Config bundler
137108 run : |
138109 bundle config set without 'development staging production'
139- bundle config set deployment '[secure] '
110+ bundle config set deployment 'true '
140111 bundle env
141112 head -n1 $(which bundle)
142113 - name : Scan for security vulnerabilities
@@ -145,3 +116,4 @@ jobs:
145116 bin/importmap audit
146117 bundle exec bundler-audit --update
147118 bin/brakeman --no-pager
119+ continue-on-error : true
0 commit comments