Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit fd7a2de

Browse files
committed
Update workflows
1 parent dd923c4 commit fd7a2de

File tree

2 files changed

+83
-81
lines changed

2 files changed

+83
-81
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,66 @@ on:
88
- '*'
99

1010
jobs:
11-
runs-on: ubuntu-latest
12-
services:
13-
postgres:
14-
image: postgres:13
15-
env:
16-
POSTGRES_USER: postgres
17-
POSTGRES_PASSWORD: password
18-
options: >-
19-
--health-cmd pg_isready
20-
--health-interval 10s
21-
--health-timeout 5s
22-
--health-retries 5
23-
ports: [ '5432:5432' ]
11+
test:
12+
runs-on: ubuntu-latest
13+
services:
14+
postgres:
15+
image: postgres:13
16+
env:
17+
POSTGRES_USER: postgres
18+
POSTGRES_PASSWORD: password
19+
options: >-
20+
--health-cmd pg_isready
21+
--health-interval 10s
22+
--health-timeout 5s
23+
--health-retries 5
24+
ports: [ '5432:5432' ]
2425

25-
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v2
28-
29-
- name: Setup ruby
30-
uses: ruby/setup-ruby@v1
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
3129

32-
- name: Setup node
33-
uses: actions/setup-node@v2
34-
with:
35-
node-version: '14'
30+
- name: Setup ruby
31+
uses: ruby/setup-ruby@v1
3632

37-
- name: Get yarn cache directory path
38-
id: yarn-cache-dir-path
39-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
40-
41-
- name: Cache yarn
42-
uses: actions/cache@v2
43-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
44-
with:
45-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
46-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
47-
restore-keys: |
48-
${{ runner.os }}-yarn
33+
- name: Setup node
34+
uses: actions/setup-node@v2
35+
with:
36+
node-version: '14'
4937

50-
- name: Cache gems
51-
uses: actions/cache@v2
52-
with:
53-
path: vendor/bundle
54-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
55-
restore-keys: |
56-
${{ runner.os }}-gems-
38+
- name: Get yarn cache directory path
39+
id: yarn-cache-dir-path
40+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
41+
42+
- name: Cache yarn
43+
uses: actions/cache@v2
44+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
45+
with:
46+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
47+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-yarn
50+
51+
- name: Cache gems
52+
uses: actions/cache@v2
53+
with:
54+
path: vendor/bundle
55+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
56+
restore-keys: |
57+
${{ runner.os }}-gems-
58+
59+
- name: Install dependencies
60+
run: |
61+
gem install bundler
62+
bundle config path vendor/bundle
63+
bundle install --jobs 4 --retry 3
64+
yarn install --frozen-lockfile
5765
58-
- name: Install dependencies
59-
run: |
60-
gem install bundler
61-
bundle config path vendor/bundle
62-
bundle install --jobs 4 --retry 3
63-
yarn install --frozen-lockfile
64-
65-
- name: Run tests
66-
env:
67-
DATABASE_URL: postgres://postgres:password@localhost:5432/test
68-
RAILS_ENV: test
69-
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
70-
run: |
71-
bin/rails db:test:prepare
72-
bundle exec rspec
66+
- name: Run tests
67+
env:
68+
DATABASE_URL: postgres://postgres:password@localhost:5432/test
69+
RAILS_ENV: test
70+
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
71+
run: |
72+
bin/rails db:test:prepare
73+
bundle exec rspec

.github/workflows/lint.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,30 @@ on:
88
- '*'
99

1010
jobs:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v2
15-
16-
- name: Setup ruby
17-
uses: ruby/setup-ruby@v1
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Setup ruby
18+
uses: ruby/setup-ruby@v1
1819

19-
- name: Cache gems
20-
uses: actions/cache@v2
21-
with:
22-
path: vendor/bundle
23-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
24-
restore-keys: |
25-
${{ runner.os }}-gems-
26-
27-
- name: Install dependencies
28-
run: |
29-
gem install bundler
30-
bundle config path vendor/bundle
31-
bundle install --jobs 4 --retry 3
20+
- name: Cache gems
21+
uses: actions/cache@v2
22+
with:
23+
path: vendor/bundle
24+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-gems-
27+
28+
- name: Install dependencies
29+
run: |
30+
gem install bundler
31+
bundle config path vendor/bundle
32+
bundle install --jobs 4 --retry 3
3233
33-
- name: Run rubocop
34-
env:
35-
RAILS_ENV: development
36-
run: bundle exec rubocop
34+
- name: Run rubocop
35+
env:
36+
RAILS_ENV: development
37+
run: bundle exec rubocop

0 commit comments

Comments
 (0)