Skip to content

Commit

Permalink
Conditionally skip test job in ci.yml (#51289)
Browse files Browse the repository at this point in the history
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.

Co-authored-by: Rafael Mendonça França <rafael@rubyonrails.org>
  • Loading branch information
stevepolitodesign and rafaelfranca committed Mar 25, 2024
1 parent 98b3183 commit 7242fd7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions railties/CHANGELOG.md
@@ -1,3 +1,8 @@
* Skip generating a `test` job in ci.yml when a new application is generated with the
`--skip-test` option.

*Steve Polito*

* Update the `.node-version` file conditionally generated for new applications to 20.11.1

*Steve Polito*
Expand Down
Expand Up @@ -59,6 +59,7 @@ jobs:
run: bin/rubocop -f github

<% end -%>
<% unless options[:skip_test] -%>
test:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -134,3 +135,4 @@ jobs:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
<% end -%>
4 changes: 4 additions & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -534,6 +534,10 @@ def test_generator_if_skip_test_is_given
assert_no_gem "selenium-webdriver"

assert_no_directory("test")

assert_file ".github/workflows/ci.yml" do |file|
assert_no_match(/test:.\s*runs-on/m, file)
end
end

def test_generator_if_skip_jbuilder_is_given
Expand Down

0 comments on commit 7242fd7

Please sign in to comment.