Skip to content

Commit d08118b

Browse files
committed
Run full test suite in latest Ruby and Rails version and upload test coverage from there only.
1 parent a70717f commit d08118b

File tree

2 files changed

+27
-37
lines changed

2 files changed

+27
-37
lines changed

.github/workflows/cicd.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,24 @@ jobs:
6565
run: bundle exec rubocop
6666

6767
- name: Run tests
68+
if: matrix.ruby-version != '3.4' || matrix.rails-version != 'rails-8.0'
6869
run: bundle exec appraisal ${{ matrix.rails-version }} rspec --tag '~generator'
6970
env: # Dummy environment variables for local providers
7071
OLLAMA_API_BASE: http://localhost:11434/v1
7172
GPUSTACK_API_BASE: http://localhost:11444/v1
7273
GPUSTACK_API_KEY: test
74+
SKIP_COVERAGE: true
75+
76+
- name: Run full test suite with coverage (latest Ruby/Rails)
77+
if: matrix.ruby-version == '3.4' && matrix.rails-version == 'rails-8.0'
78+
run: bundle exec appraisal ${{ matrix.rails-version }} rspec
79+
env: # Dummy environment variables for local providers
80+
OLLAMA_API_BASE: http://localhost:11434/v1
81+
GPUSTACK_API_BASE: http://localhost:11444/v1
82+
GPUSTACK_API_KEY: test
7383

7484
- name: Upload coverage to Codecov
85+
if: matrix.ruby-version == '3.4' && matrix.rails-version == 'rails-8.0'
7586
uses: codecov/codecov-action@v5
7687
env:
7788
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -88,34 +99,11 @@ jobs:
8899
OLLAMA_API_BASE: http://localhost:11434/v1
89100
GPUSTACK_API_BASE: http://localhost:11444/v1
90101
GPUSTACK_API_KEY: test
91-
92-
generator-tests:
93-
runs-on: ubuntu-latest
94-
95-
steps:
96-
- uses: actions/checkout@v4
97-
98-
- name: Set up Ruby
99-
uses: ruby/setup-ruby@v1
100-
with:
101-
ruby-version: '3.4'
102-
bundler-cache: true
103-
104-
- name: Install dependencies
105-
run: |
106-
bundle install
107-
bundle exec appraisal rails-8.0 bundle install
108-
109-
- name: Run generator tests
110-
run: bundle exec appraisal rails-8.0 rspec --tag generator
111-
env: # Dummy environment variables for local providers
112-
OLLAMA_API_BASE: http://localhost:11434/v1
113-
GPUSTACK_API_BASE: http://localhost:11444/v1
114-
GPUSTACK_API_KEY: test
102+
SKIP_COVERAGE: true
115103

116104
publish:
117105
name: Build + Publish
118-
needs: [test, generator-tests]
106+
needs: test
119107
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
120108
runs-on: ubuntu-latest
121109

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# frozen_string_literal: true
22

3-
SimpleCov.start do
4-
add_filter '/spec/'
5-
add_filter '/vendor/'
6-
add_filter 'acts_as_legacy.rb'
3+
unless ENV['SKIP_COVERAGE']
4+
SimpleCov.start do
5+
add_filter '/spec/'
6+
add_filter '/vendor/'
7+
add_filter 'acts_as_legacy.rb'
78

8-
enable_coverage :branch
9+
enable_coverage :branch
910

10-
formatter SimpleCov::Formatter::MultiFormatter.new(
11-
[
12-
SimpleCov::Formatter::SimpleFormatter,
13-
(SimpleCov::Formatter::Codecov if ENV['CODECOV_TOKEN']),
14-
SimpleCov::Formatter::CoberturaFormatter
15-
].compact
16-
)
11+
formatter SimpleCov::Formatter::MultiFormatter.new(
12+
[
13+
SimpleCov::Formatter::SimpleFormatter,
14+
(SimpleCov::Formatter::Codecov if ENV['CODECOV_TOKEN']),
15+
SimpleCov::Formatter::CoberturaFormatter
16+
].compact
17+
)
18+
end
1719
end

0 commit comments

Comments
 (0)