File tree Expand file tree Collapse file tree 4 files changed +80
-67
lines changed
Expand file tree Collapse file tree 4 files changed +80
-67
lines changed Original file line number Diff line number Diff line change 1+ name : " Ruby on Rails CI"
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ services :
14+ postgres :
15+ image : postgres:15-alpine
16+ ports :
17+ - " 5432:5432"
18+ env :
19+ POSTGRES_DB : rails_test
20+ POSTGRES_USER : rails
21+ POSTGRES_PASSWORD : password
22+ options : >-
23+ --health-cmd pg_isready
24+ --health-interval 10s
25+ --health-timeout 5s
26+ --health-retries 5
27+
28+ steps :
29+ - name : Checkout code
30+ uses : actions/checkout@v4
31+
32+ - name : Set up Docker Buildx
33+ uses : docker/setup-buildx-action@v3
34+
35+ - name : Build Docker image
36+ run : docker build -t money-sleuth:test .
37+
38+ - name : Run tests in Docker
39+ run : |
40+ docker run --rm \
41+ --network host \
42+ -v ${{ github.workspace }}:/myapp \
43+ -e RAILS_ENV=test \
44+ -e DATABASE_URL="postgres://rails:password@localhost:5432/rails_test" \
45+ -e BASIC_AUTH_ADMIN_PASSWORD="password" \
46+ money-sleuth:test \
47+ bash -c "bin/rails db:schema:load && bin/rails assets:precompile && bin/rake"
48+
49+ lint :
50+ runs-on : ubuntu-latest
51+
52+ steps :
53+ - name : Checkout code
54+ uses : actions/checkout@v4
55+
56+ - name : Set up Docker Buildx
57+ uses : docker/setup-buildx-action@v3
58+
59+ - name : Build Docker image
60+ run : docker build -t money-sleuth:test .
61+
62+ - name : Run linting in Docker
63+ run : |
64+ docker run --rm \
65+ -v ${{ github.workspace }}:/myapp \
66+ money-sleuth:test \
67+ bash -c "
68+ bundle exec bundler-audit --update
69+ bundle exec bundler-audit
70+ bundle exec brakeman -q -w2
71+ bundle exec rubocop --parallel
72+ "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ group :development do
5353 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
5454 gem 'spring'
5555 gem 'spring-watcher-listen' , '~> 2.0.0'
56+
57+ # Linting and security tools
58+ gem 'rubocop' , require : false
59+ gem 'brakeman' , require : false
60+ gem 'bundler-audit' , require : false
5661end
5762
5863group :test do
Original file line number Diff line number Diff line change 169169 net-protocol (0.2.2 )
170170 timeout
171171 net-smtp (0.4.0.1 )
172- net-protocol
173172 nio4r (2.7.0 )
173+ nokogiri (1.16.2-arm64-darwin )
174+ racc (~> 1.4 )
174175 nokogiri (1.16.2-x86_64-linux )
175176 racc (~> 1.4 )
176177 pg (1.5.5 )
311312 zeitwerk (2.6.13 )
312313
313314PLATFORMS
315+ arm64-darwin-24
314316 x86_64-linux
315317
316318DEPENDENCIES
You can’t perform that action at this time.
0 commit comments