@@ -11,45 +11,57 @@ jobs:
11
11
12
12
steps :
13
13
- name : Checkout code
14
- uses : actions/checkout@v4
14
+ uses : actions/checkout@v5
15
15
16
16
- name : Set up Ruby
17
17
uses : ruby/setup-ruby@v1
18
18
with :
19
- ruby-version : .ruby-version
20
19
bundler-cache : true
21
20
22
21
- name : Scan for common Rails security vulnerabilities using static analysis
23
22
run : bin/brakeman --no-pager
24
23
24
+ - name : Scan for known security vulnerabilities in gems used
25
+ run : bin/bundler-audit
26
+
25
27
scan_js :
26
28
runs-on : ubuntu-latest
27
29
28
30
steps :
29
31
- name : Checkout code
30
- uses : actions/checkout@v4
32
+ uses : actions/checkout@v5
31
33
32
34
- name : Set up Ruby
33
35
uses : ruby/setup-ruby@v1
34
36
with :
35
- ruby-version : .ruby-version
36
37
bundler-cache : true
37
38
38
39
- name : Scan for security vulnerabilities in JavaScript dependencies
39
40
run : bin/importmap audit
40
41
41
42
lint :
42
43
runs-on : ubuntu-latest
44
+ env :
45
+ RUBOCOP_CACHE_ROOT : tmp/rubocop
43
46
steps :
44
47
- name : Checkout code
45
- uses : actions/checkout@v4
48
+ uses : actions/checkout@v5
46
49
47
50
- name : Set up Ruby
48
51
uses : ruby/setup-ruby@v1
49
52
with :
50
- ruby-version : .ruby-version
51
53
bundler-cache : true
52
54
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
+
53
65
- name : Lint code for consistent style
54
66
run : bin/rubocop -f github
55
67
@@ -58,28 +70,50 @@ jobs:
58
70
59
71
# services:
60
72
# redis:
61
- # image: redis
73
+ # image: valkey/valkey:8
62
74
# ports:
63
75
# - 6379:6379
64
76
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
65
77
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
-
69
78
- name : Checkout code
70
- uses : actions/checkout@v4
79
+ uses : actions/checkout@v5
71
80
72
81
- name : Set up Ruby
73
82
uses : ruby/setup-ruby@v1
74
83
with :
75
- ruby-version : .ruby-version
76
84
bundler-cache : true
77
85
78
86
- name : Run tests
79
87
env :
80
88
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 }}
81
115
# 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
83
117
84
118
- name : Keep screenshots from failed system tests
85
119
uses : actions/upload-artifact@v4
0 commit comments