Skip to content

Commit 2c55477

Browse files
committed
ci: Setup Rails 8.1 GitHub workflows
1 parent e5a66b5 commit 2c55477

5 files changed

Lines changed: 198 additions & 1 deletion

File tree

.github/workflows/linters.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
env:
3939
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
run: |
41-
reviewdog -fail-on-error -reporter=github-pr-review -runners=brakeman,fasterer,rubocop
41+
reviewdog -fail-on-error -reporter=github-pr-review -runners=fasterer,rubocop
4242
43+
# NOTE: removed brakeman due some issues
4344
# NOTE: check with: reviewdog -fail-on-error -reporter=github-pr-review -runners=fasterer -diff="git diff" -tee
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Specs MSSQL Rails 8.1
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['3.2', '3.4']
17+
18+
env:
19+
DB_TEST: mssql
20+
RAILS_VERSION: 8.1
21+
22+
services:
23+
postgres:
24+
image: mcr.microsoft.com/mssql/server:2022-latest
25+
env:
26+
ACCEPT_EULA: 'Y'
27+
SA_PASSWORD: Pa%%w0rd
28+
ports:
29+
- 1433:1433
30+
31+
steps:
32+
- name: Install dependencies
33+
run: sudo apt-get update -qq && sudo apt-get install -yqq freetds-dev freetds-bin libvips-dev
34+
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Ruby
39+
uses: ruby/setup-ruby@v1
40+
with:
41+
ruby-version: ${{ matrix.ruby }}
42+
bundler-cache: true
43+
44+
- name: Database setup
45+
run: bin/rails db:create db:migrate db:test:prepare
46+
47+
- name: Run tests
48+
run: bin/rspec --profile
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Specs MySQL Rails 8.1
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['3.2', '3.4']
17+
18+
env:
19+
DB_TEST: mysql
20+
RAILS_VERSION: 8.1
21+
22+
services:
23+
mysql:
24+
image: mysql
25+
env:
26+
MYSQL_USER: root
27+
MYSQL_PASSWORD: root
28+
# options: >-
29+
# --health-cmd="mysqladmin ping"
30+
# --health-interval 10s
31+
# --health-timeout 5s
32+
# --health-retries 5
33+
ports:
34+
- 3306:3306
35+
36+
steps:
37+
- name: Install dependencies
38+
run: sudo apt-get update -qq && sudo apt-get install -yqq freetds-dev freetds-bin libvips-dev
39+
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Ruby
44+
uses: ruby/setup-ruby@v1
45+
with:
46+
ruby-version: ${{ matrix.ruby }}
47+
bundler-cache: true
48+
49+
- name: Start database service
50+
run: sudo /etc/init.d/mysql start
51+
52+
- name: Database setup
53+
run: bin/rails db:create db:migrate db:test:prepare
54+
55+
- name: Run tests
56+
run: bin/rspec --profile
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: Specs Postgres Rails 8.1
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['3.2', '3.4']
17+
18+
env:
19+
DB_TEST: postgres
20+
RAILS_VERSION: 8.1
21+
22+
services:
23+
postgres:
24+
image: postgres:latest
25+
env:
26+
POSTGRES_USER: postgres
27+
POSTGRES_PASSWORD: password
28+
options: >-
29+
--health-cmd pg_isready
30+
--health-interval 10s
31+
--health-timeout 5s
32+
--health-retries 5
33+
ports:
34+
- 5432:5432
35+
36+
steps:
37+
- name: Install dependencies
38+
run: sudo apt-get update -qq && sudo apt-get install -yqq freetds-dev freetds-bin libvips-dev
39+
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Ruby
44+
uses: ruby/setup-ruby@v1
45+
with:
46+
ruby-version: ${{ matrix.ruby }}
47+
bundler-cache: true
48+
49+
- name: Database setup
50+
run: bin/rails db:create db:migrate db:test:prepare
51+
52+
- name: Run tests
53+
run: bin/rspec --profile
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Specs SQLite Rails 8.1
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['3.2', '3.3', '3.4']
17+
18+
env:
19+
DB_TEST: sqlite
20+
RAILS_VERSION: 8.1
21+
22+
steps:
23+
- name: Install dependencies
24+
run: sudo apt-get update -qq && sudo apt-get install -yqq freetds-dev freetds-bin libvips-dev
25+
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Ruby
30+
uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: ${{ matrix.ruby }}
33+
bundler-cache: true
34+
35+
- name: Database setup
36+
run: bin/rails db:create db:migrate db:test:prepare
37+
38+
- name: Run tests
39+
run: bin/rspec --profile

0 commit comments

Comments
 (0)