Skip to content

Commit dac888a

Browse files
committed
Run tests before release-specific changes in workflow
Critical fix: Move quality gates (tests, lint, security) to run BEFORE version patching and gem building. This ensures we're testing the actual committed code, not modified versions. Changes: - Enable bundler-cache for faster dependency installation - Run tests, RuboCop, and security audit immediately after setup - Move version patching and platform lock steps after quality gates - Ensures release fails early if tests don't pass on committed code
1 parent 3ed0701 commit dac888a

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,24 @@ jobs:
3737
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3838
echo "Using version: $VERSION"
3939
40-
# Install Ruby BEFORE any `ruby -e` or bundler calls
40+
# Install Ruby and run tests BEFORE any release-specific changes
4141
- name: Set up Ruby
4242
uses: ruby/setup-ruby@v1
4343
with:
4444
ruby-version: "3.2"
45-
bundler-cache: false
45+
bundler-cache: true
46+
47+
- name: Run tests
48+
id: tests
49+
run: bundle exec rspec
50+
51+
- name: Run RuboCop
52+
id: rubocop
53+
run: bundle exec rubocop
54+
55+
- name: Run security audit
56+
id: security
57+
run: bundle exec bundle-audit check --update
4658

4759
- name: Read version.rb
4860
id: file
@@ -67,21 +79,6 @@ jobs:
6779
bundle lock --add-platform x86_64-linux
6880
bundle lock --add-platform ruby
6981
70-
- name: Install dependencies
71-
run: bundle install --jobs 4 --retry 3
72-
73-
- name: Run tests
74-
id: tests
75-
run: bundle exec rspec
76-
77-
- name: Run RuboCop
78-
id: rubocop
79-
run: bundle exec rubocop
80-
81-
- name: Run security audit
82-
id: security
83-
run: bundle exec bundle-audit check --update
84-
8582
- name: Build gem
8683
id: build
8784
shell: bash

0 commit comments

Comments
 (0)