Skip to content

Commit 45c7bb5

Browse files
author
Mattia Roccoberton
authored
Merge pull request #22 from blocknotes/spec-improvements
Spec improvements
2 parents c39b9e4 + 8321450 commit 45c7bb5

196 files changed

Lines changed: 1486 additions & 58 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fasterer.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
exclude_paths:
33
- bin/*
44
- db/schema.rb
5-
- spec/dummy/**/*
6-
- spec/dummy7/**/*
5+
- spec/dummy??/**/*
76
- vendor/**/*
87

98
speedups:

.github/workflows/linters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
env:
3232
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333
run: |
34-
reviewdog -fail-on-error -reporter=github-pr-review -runners=brakeman,fasterer,reek,rubocop
34+
reviewdog -fail-on-error -reporter=github-pr-review -runners=brakeman,fasterer,rubocop
3535
3636
# NOTE: check with: reviewdog -fail-on-error -reporter=github-pr-review -runners=fasterer -diff="git diff" -tee
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Specs - MySQL
2+
name: Specs Rails 6.0 MySQL
33

44
on:
55
pull_request:
@@ -14,14 +14,15 @@ jobs:
1414
strategy:
1515
matrix:
1616
ruby: ['2.6', '2.7', '3.0']
17-
gemfile: ['rails_6_1_mysql', 'rails_6_0_mysql']
17+
gemfile: ['rails_6_0_mysql']
1818

1919
env:
2020
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
2121
DB_TEST: mysql
2222
MYSQL_DB_HOST: 127.0.0.1
2323
MYSQL_DB_USERNAME: root
2424
MYSQL_DB_PASSWORD: root
25+
RAILS: '6.0'
2526

2627
services:
2728
mysql:
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
name: Specs Rails 6.1 MySQL
3+
4+
on:
5+
pull_request:
6+
branches: [master]
7+
push:
8+
branches: [master]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['2.6', '2.7', '3.0']
17+
gemfile: ['rails_6_1_mysql']
18+
19+
env:
20+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
21+
DB_TEST: mysql
22+
MYSQL_DB_HOST: 127.0.0.1
23+
MYSQL_DB_USERNAME: root
24+
MYSQL_DB_PASSWORD: root
25+
RAILS: '6.1'
26+
27+
services:
28+
mysql:
29+
image: mysql
30+
env:
31+
MYSQL_USER: root
32+
MYSQL_PASSWORD: root
33+
# options: >-
34+
# --health-cmd="mysqladmin ping"
35+
# --health-interval 10s
36+
# --health-timeout 5s
37+
# --health-retries 5
38+
ports:
39+
- 3306:3306
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v2
44+
45+
- name: Set up Ruby
46+
uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby }}
49+
bundler-cache: true
50+
51+
- name: Start database service
52+
run: sudo /etc/init.d/mysql start
53+
54+
- name: Create database
55+
run: bundle exec rails db:create
56+
57+
- name: Apply migrations
58+
run: bundle exec rails db:migrate
59+
60+
- name: Run tests
61+
run: bundle exec rspec --profile
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Specs - MySQL
2+
name: Specs Rails 7.0 MySQL
33

44
on:
55
pull_request:
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Specs - Postgres
2+
name: Specs Rails 6.0 Postgres
33

44
on:
55
pull_request:
@@ -14,14 +14,15 @@ jobs:
1414
strategy:
1515
matrix:
1616
ruby: ['2.6', '2.7', '3.0']
17-
gemfile: ['rails_6_1_postgres', 'rails_6_0_postgres']
17+
gemfile: ['rails_6_0_postgres']
1818

1919
env:
2020
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
2121
DB_TEST: postgres
2222
PG_DB_HOST: 127.0.0.1
2323
PG_DB_USERNAME: postgres
2424
PG_DB_PASSWORD: postgres
25+
RAILS: '6.0'
2526

2627
services:
2728
postgres:
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: Specs Rails 6.1 Postgres
3+
4+
on:
5+
pull_request:
6+
branches: [master]
7+
push:
8+
branches: [master]
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
ruby: ['2.6', '2.7', '3.0']
17+
gemfile: ['rails_6_1_postgres']
18+
19+
env:
20+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
21+
DB_TEST: postgres
22+
PG_DB_HOST: 127.0.0.1
23+
PG_DB_USERNAME: postgres
24+
PG_DB_PASSWORD: postgres
25+
RAILS: '6.1'
26+
27+
services:
28+
postgres:
29+
image: postgres:latest
30+
env:
31+
POSTGRES_USER: postgres
32+
POSTGRES_PASSWORD: postgres
33+
options: >-
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
ports:
39+
- 5432:5432
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v2
44+
45+
- name: Set up Ruby
46+
uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby }}
49+
bundler-cache: true
50+
51+
- name: Create database
52+
run: bundle exec rails db:create
53+
54+
- name: Apply migrations
55+
run: bundle exec rails db:migrate
56+
57+
- name: Run tests
58+
run: bundle exec rspec --profile
59+
60+
# - name: Upload coverage results
61+
# uses: actions/upload-artifact@master
62+
# if: always()
63+
# with:
64+
# name: coverage-report
65+
# path: coverage/index.html

.github/workflows/specs_postgres_rails7.yml renamed to .github/workflows/specs_postgres_70.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Specs - Postgres
2+
name: Specs Rails 7.0 Postgres
33

44
on:
55
pull_request:

.gitignore

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
log/*.log
33
pkg/
44

5-
/spec/dummy/db/*.sqlite3
6-
/spec/dummy/db/*.sqlite3-journal
7-
/spec/dummy/db/*.sqlite3-*
8-
/spec/dummy/log/*
9-
/spec/dummy/storage/
10-
/spec/dummy/tmp/
11-
/spec/dummy/db/schema.rb
12-
13-
/spec/dummy7/db/*.sqlite3
14-
/spec/dummy7/db/*.sqlite3-journal
15-
/spec/dummy7/db/*.sqlite3-*
16-
/spec/dummy7/log/*
17-
/spec/dummy7/storage/
18-
/spec/dummy7/tmp/
19-
/spec/dummy7/db/schema.rb
5+
/spec/dummy??/db/*.sqlite3
6+
/spec/dummy??/db/*.sqlite3-journal
7+
/spec/dummy??/db/*.sqlite3-*
8+
/spec/dummy??/log/
9+
/spec/dummy??/storage/
10+
/spec/dummy??/tmp/
2011

2112
/.rubocop-*
2213
/coverage/

.reek.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
exclude_paths:
33
- bin/*
44
- db/schema.rb
5-
- spec/dummy/**/*
5+
- spec/dummy??/**/*
66
- vendor/**/*

0 commit comments

Comments
 (0)