@@ -10,78 +10,58 @@ jobs:
1010 runs-on : ubuntu-latest
1111
1212 steps :
13- - name : Checkout code
14- uses : actions/checkout@v6
13+ - uses : actions/checkout@v6
1514
16- - name : Set up Ruby
17- uses : ruby/setup-ruby@v1
15+ - uses : ruby/setup-ruby@v1
1816 with :
17+ ruby-version : 3.3
1918 bundler-cache : true
2019
21- - name : Scan for common Rails security vulnerabilities using static analysis
20+ - name : Brakeman
2221 run : bin/brakeman --no-pager
2322
24- - name : Scan for known security vulnerabilities in gems used
23+ - name : Bundler Audit
2524 run : bin/bundler-audit
2625
27- scan_js :
28- runs-on : ubuntu-latest
29-
30- steps :
31- - name : Checkout code
32- uses : actions/checkout@v6
33-
34- - name : Set up Ruby
35- uses : ruby/setup-ruby@v1
36- with :
37- bundler-cache : true
38-
3926 lint :
4027 runs-on : ubuntu-latest
4128 env :
4229 RUBOCOP_CACHE_ROOT : tmp/rubocop
30+
4331 steps :
44- - name : Checkout code
45- uses : actions/checkout@v6
32+ - uses : actions/checkout@v6
4633
47- - name : Set up Ruby
48- uses : ruby/setup-ruby@v1
34+ - uses : ruby/setup-ruby@v1
4935 with :
36+ ruby-version : 3.3
5037 bundler-cache : true
5138
52- - name : Prepare RuboCop cache
39+ - name : Cache RuboCop
5340 uses : actions/cache@v4
54- env :
55- DEPENDENCIES_HASH : ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
5641 with :
5742 path : ${{ env.RUBOCOP_CACHE_ROOT }}
58- key : rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
59- restore-keys : |
60- rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-
43+ key : rubocop-${{ runner.os }}-${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }}
6144
62- - name : Lint code for consistent style
45+ - name : RuboCop
6346 run : bin/rubocop -f github
6447
6548 test :
6649 runs-on : ubuntu-latest
6750
6851 steps :
69- - name : Checkout code
70- uses : actions/checkout@v4
52+ - uses : actions/checkout@v6
7153
72- - name : Set up Ruby
73- uses : ruby/setup-ruby@v1
54+ - uses : ruby/setup-ruby@v1
7455 with :
7556 ruby-version : 3.3
7657 bundler-cache : true
7758
78- - name : Set up Node
79- uses : actions/setup-node@v4
59+ - uses : actions/setup-node@v4
8060 with :
8161 node-version : 22
8262 cache : npm
8363
84- - name : Install JS dependencies
64+ - name : Install JS deps
8565 run : npm ci
8666
8767 - name : Build Vite assets (test)
@@ -97,32 +77,39 @@ jobs:
9777 system-test :
9878 runs-on : ubuntu-latest
9979
100- # services:
101- # redis:
102- # image: valkey/valkey:8
103- # ports:
104- # - 6379:6379
105- # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
10680 steps :
107- - name : Checkout code
108- uses : actions/checkout@v6
81+ - uses : actions/checkout@v6
10982
110- - name : Set up Ruby
111- uses : ruby/setup-ruby@v1
83+ - uses : ruby/setup-ruby@v1
11284 with :
85+ ruby-version : 3.3
11386 bundler-cache : true
11487
115- - name : Run System Tests
88+ - uses : actions/setup-node@v4
89+ with :
90+ node-version : 22
91+ cache : npm
92+
93+ - name : Install JS deps
94+ run : npm ci
95+
96+ - name : Build Vite assets (test)
97+ run : npm run build -- --mode=test
98+ env :
99+ RAILS_ENV : test
100+
101+ - name : Install Chrome
102+ uses : browser-actions/setup-chrome@v1
103+
104+ - name : Run system tests
116105 env :
117106 RAILS_ENV : test
118- # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
119- # REDIS_URL: redis://localhost:6379/0
120107 run : bin/rails db:test:prepare test:system
121108
122- - name : Keep screenshots from failed system tests
123- uses : actions/upload-artifact@v4
109+ - name : Upload screenshots
124110 if : failure()
111+ uses : actions/upload-artifact@v4
125112 with :
126113 name : screenshots
127- path : ${{ github.workspace }}/ tmp/screenshots
114+ path : tmp/screenshots
128115 if-no-files-found : ignore
0 commit comments