@@ -2,46 +2,82 @@ name: Ruby
22on : [push, pull_request]
33permissions :
44 contents : read
5+
56jobs :
7+ lint :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@v4.1.0
11+
12+ - name : Set up Ruby
13+ uses : ruby/setup-ruby@v1
14+ with :
15+ ruby-version : 3.4
16+ bundler-cache : true
17+
18+ - name : Run RuboCop
19+ run : |
20+ echo "::group::RuboCop"
21+ bundle exec rubocop --format progress --format clang
22+ echo "::endgroup::"
23+
624 test :
725 runs-on : ubuntu-latest
26+ needs : lint
827 steps :
9- - uses : actions/checkout@v4.1.0
10- - name : Set up Ruby
11- uses : ruby/setup-ruby@v1
12- with :
13- ruby-version : 3.4
14- bundler-cache : true
15- - name : Install dependencies
16- run : |
17- gem install rails
18- bundle install
19- - name : Check Ruby Syntax in .rb files
20- run : find ./app/ | grep ".*\.rb$" | xargs -L 1 ruby -c
21- - name : Setup database
22- run : rails db:migrate RAILS_ENV=test
23- - name : Run tests
24- run : bundle exec rake
28+ - uses : actions/checkout@v4.1.0
29+
30+ - name : Set up Ruby
31+ uses : ruby/setup-ruby@v1
32+ with :
33+ ruby-version : 3.4
34+ bundler-cache : true
35+
36+ - name : Database migrations
37+ run : |
38+ echo "::group::Database Migrations"
39+ bundle exec rails db:migrate RAILS_ENV=test
40+ echo "::endgroup::"
41+
42+ - name : CI health check
43+ run : |
44+ echo "::group::CI Health Check"
45+ bundle exec rails ci:health RAILS_ENV=test
46+ echo "::endgroup::"
47+
48+ - name : Run tests
49+ run : |
50+ echo "::group::Running Tests"
51+ bundle exec rails test RAILS_ENV=test --verbose
52+ echo "::endgroup::"
2553
2654 smoke-test :
2755 runs-on : ubuntu-latest
2856 needs : test
2957 steps :
30- - uses : actions/checkout@v4.1.0
31- - name : Set up Ruby
32- uses : ruby/setup-ruby@v1
33- with :
34- ruby-version : 3.4
35- bundler-cache : true
36- - name : Install dependencies
37- run : |
38- gem install rails
39- bundle install
40- - name : Make scripts executable
41- run : |
42- chmod +x start-app.sh
43- chmod +x stop-app.sh
44- chmod +x status.sh
45- chmod +x smoke-ci.sh
46- - name : Run smoke CI test
47- run : ./smoke-ci.sh
58+ - uses : actions/checkout@v4.1.0
59+
60+ - name : Set up Ruby
61+ uses : ruby/setup-ruby@v1
62+ with :
63+ ruby-version : 3.4
64+ bundler-cache : true
65+
66+ - name : Database migrations
67+ run : |
68+ echo "::group::Database Migrations"
69+ bundle exec rails db:migrate RAILS_ENV=test
70+ echo "::endgroup::"
71+
72+ - name : Make scripts executable
73+ run : |
74+ chmod +x start-app.sh
75+ chmod +x stop-app.sh
76+ chmod +x status.sh
77+ chmod +x smoke-ci.sh
78+
79+ - name : Run smoke CI test
80+ run : |
81+ echo "::group::Smoke Test"
82+ ./smoke-ci.sh
83+ echo "::endgroup::"
0 commit comments