@@ -19,13 +19,16 @@ jobs:
1919 --health-retries 5
2020
2121 steps :
22+ - name : Install packages
23+ run : sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client
24+
2225 - name : Checkout code
2326 uses : actions/checkout@v4
2427
2528 - name : Setup Ruby
2629 uses : ruby/setup-ruby@v1
2730 with :
28- ruby-version : 3.3
31+ ruby-version : .ruby-version
2932 bundler-cache : true
3033
3134 - name : Setup Node
@@ -59,15 +62,14 @@ jobs:
5962 cp config/action_mailer.yml.ci config/action_mailer.yml
6063 cp config/code_ocean.yml.ci config/code_ocean.yml
6164 cp config/database.yml.ci config/database.yml
62- cp config/secrets.yml.ci config/secrets.yml
6365 cp config/docker.yml.erb.ci config/docker.yml.erb
6466 cp config/mnemosyne.yml.ci config/mnemosyne.yml
6567 cp config/content_security_policy.yml.ci config/content_security_policy.yml
6668
67- - name : Create database
69+ - name : Prepare database
6870 env :
6971 RAILS_ENV : test
70- run : bundler exec rake db:schema:load
72+ run : bundler exec rake db:prepare
7173 - name : Precompile assets
7274 env :
7375 RAILS_ENV : test
8486 with :
8587 token : ${{ secrets.CODECOV_TOKEN }}
8688
89+ - name : Keep screenshots from failed system specs
90+ uses : actions/upload-artifact@v4
91+ if : failure()
92+ with :
93+ name : screenshots
94+ path : ${{ github.workspace }}/tmp/screenshots
95+ if-no-files-found : ignore
96+
8797 lint :
8898 runs-on : ubuntu-latest
8999
94104 - name : Setup Ruby
95105 uses : ruby/setup-ruby@v1
96106 with :
97- ruby-version : 3.3
107+ ruby-version : .ruby-version
98108 bundler-cache : true
99109
100110 - name : Run rubocop
@@ -125,17 +135,39 @@ jobs:
125135 - name : Setup Ruby
126136 uses : ruby/setup-ruby@v1
127137 with :
128- ruby-version : 3.3
138+ ruby-version : .ruby-version
129139 bundler-cache : true
130140
131141 - name : Run slim-lint
132142 run : bundle exec slim-lint app/views --reporter checkstyle > checkstyle-result.xml
133143
134144 - name : Upload slim-lint results as GitHub annotations
135- uses : lcollins/checkstyle-github-action@v3.0 .0
145+ uses : lcollins/checkstyle-github-action@v3.1 .0
136146 # Only create GitHub annotations for the main repo (disable for forks):
137- if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
147+ if : ${{ always() && github.event.pull_request.head.repo.full_name == github.repository }}
138148 with :
139149 name : Slim-Lint Report
140150 title : Analyze Slim templates for linting issues
141151 path : checkstyle-result.xml
152+
153+ scan_ruby :
154+ runs-on : ubuntu-latest
155+
156+ steps :
157+ - name : Checkout code
158+ uses : actions/checkout@v4
159+
160+ - name : Set up Ruby
161+ uses : ruby/setup-ruby@v1
162+ with :
163+ ruby-version : .ruby-version
164+ bundler-cache : true
165+
166+ - name : Scan for common Rails security vulnerabilities using static analysis
167+ uses : reviewdog/action-brakeman@v2
168+ with :
169+ filter_mode : nofilter
170+ reporter : github-check
171+ skip_install : true
172+ use_bundler : true
173+ fail_on_error : true
0 commit comments