@@ -11,45 +11,57 @@ jobs:
1111
1212 steps :
1313 - name : Checkout code
14- uses : actions/checkout@v4
14+ uses : actions/checkout@v5
1515
1616 - name : Set up Ruby
1717 uses : ruby/setup-ruby@v1
1818 with :
19- ruby-version : .ruby-version
2019 bundler-cache : true
2120
2221 - name : Scan for common Rails security vulnerabilities using static analysis
2322 run : bin/brakeman --no-pager
2423
24+ - name : Scan for known security vulnerabilities in gems used
25+ run : bin/bundler-audit
26+
2527 scan_js :
2628 runs-on : ubuntu-latest
2729
2830 steps :
2931 - name : Checkout code
30- uses : actions/checkout@v4
32+ uses : actions/checkout@v5
3133
3234 - name : Set up Ruby
3335 uses : ruby/setup-ruby@v1
3436 with :
35- ruby-version : .ruby-version
3637 bundler-cache : true
3738
3839 - name : Scan for security vulnerabilities in JavaScript dependencies
3940 run : bin/importmap audit
4041
4142 lint :
4243 runs-on : ubuntu-latest
44+ env :
45+ RUBOCOP_CACHE_ROOT : tmp/rubocop
4346 steps :
4447 - name : Checkout code
45- uses : actions/checkout@v4
48+ uses : actions/checkout@v5
4649
4750 - name : Set up Ruby
4851 uses : ruby/setup-ruby@v1
4952 with :
50- ruby-version : .ruby-version
5153 bundler-cache : true
5254
55+ - name : Prepare RuboCop cache
56+ uses : actions/cache@v4
57+ env :
58+ DEPENDENCIES_HASH : ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
59+ with :
60+ path : ${{ env.RUBOCOP_CACHE_ROOT }}
61+ key : rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
62+ restore-keys : |
63+ rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
64+
5365 - name : Lint code for consistent style
5466 run : bin/rubocop -f github
5567
@@ -58,28 +70,50 @@ jobs:
5870
5971 # services:
6072 # redis:
61- # image: redis
73+ # image: valkey/valkey:8
6274 # ports:
6375 # - 6379:6379
6476 # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
6577 steps :
66- - name : Install packages
67- run : sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config google-chrome-stable
68-
6978 - name : Checkout code
70- uses : actions/checkout@v4
79+ uses : actions/checkout@v5
7180
7281 - name : Set up Ruby
7382 uses : ruby/setup-ruby@v1
7483 with :
75- ruby-version : .ruby-version
7684 bundler-cache : true
7785
7886 - name : Run tests
7987 env :
8088 RAILS_ENV : test
89+ # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
90+ # REDIS_URL: redis://localhost:6379/0
91+ run : bin/rails db:test:prepare test
92+
93+ system-test :
94+ runs-on : ubuntu-latest
95+
96+ # services:
97+ # redis:
98+ # image: valkey/valkey:8
99+ # ports:
100+ # - 6379:6379
101+ # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
102+ steps :
103+ - name : Checkout code
104+ uses : actions/checkout@v5
105+
106+ - name : Set up Ruby
107+ uses : ruby/setup-ruby@v1
108+ with :
109+ bundler-cache : true
110+
111+ - name : Run System Tests
112+ env :
113+ RAILS_ENV : test
114+ # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
81115 # REDIS_URL: redis://localhost:6379/0
82- run : bin/rails db:test:prepare test test :system
116+ run : bin/rails db:test:prepare test:system
83117
84118 - name : Keep screenshots from failed system tests
85119 uses : actions/upload-artifact@v4
0 commit comments