Skip to content

Commit f340802

Browse files
committed
improve naming and lint file
1 parent a7f3fff commit f340802

1 file changed

Lines changed: 137 additions & 123 deletions

File tree

.github/workflows/tests.yml

Lines changed: 137 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ env:
3131
COVERAGE: true
3232

3333
jobs:
34+
# ----------------------------------------------------------------------------
35+
# Feature specs
36+
# ----------------------------------------------------------------------------
3437
feature:
38+
name: feature (Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }})
3539
strategy:
3640
matrix:
3741
ruby:
@@ -43,77 +47,82 @@ jobs:
4347
runs-on: ubuntu-latest
4448

4549
env:
46-
RAILS_VERSION: ${{matrix.rails}}
50+
RAILS_VERSION: ${{ matrix.rails }}
4751
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}.gemfile
4852

4953
services:
5054
postgres:
5155
image: postgres:10.8
52-
ports: ["5432:5432"]
56+
ports:
57+
- 5432:5432
5358
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
5459

5560
steps:
56-
- uses: actions/checkout@v4
57-
58-
- name: Set up Ruby
59-
uses: ruby/setup-ruby@v1
60-
with:
61-
bundler-cache: true
62-
bundler: default
63-
ruby-version: ${{ matrix.ruby }}
64-
65-
- name: Prepare database
66-
run: |
67-
bin/rails db:create
68-
bin/rails db:migrate
69-
70-
- name: Get yarn cache directory path
71-
id: test-yarn-cache-dir-path
72-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
73-
74-
- uses: actions/cache@v4
75-
id: test-yarn-cache
76-
with:
77-
path: ${{ steps.test-yarn-cache-dir-path.outputs.dir }}
78-
key: ${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
79-
restore-keys: |
80-
${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
81-
82-
- name: Yarn install the dummy app
83-
run: |
84-
cd spec/dummy
85-
yarn
86-
87-
- name: Yarn install
88-
run: yarn
89-
90-
- name: Build assets
91-
env:
92-
RAILS_ENV: production
93-
NODE_ENV: production
94-
run: |
95-
yarn build:js
96-
yarn build:css
97-
yarn build:custom-js
98-
99-
- name: Run tests
100-
id: run_tests
101-
run: bundle exec rspec spec/features
102-
103-
- uses: actions/upload-artifact@v4
104-
with:
105-
name: coverage_features_${{ matrix.rails }}_ruby_${{ matrix.ruby }}
106-
path: coverage/.resultset.json
107-
108-
- uses: actions/upload-artifact@v4
109-
if: always() && steps.run_tests.outcome == 'failure'
110-
with:
111-
name: rspec_failed_screenshots_rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}
112-
path: |
113-
./spec/dummy/tmp/screenshots
114-
./spec/examples.txt
115-
61+
- uses: actions/checkout@v4
62+
63+
- name: Set up Ruby
64+
uses: ruby/setup-ruby@v1
65+
with:
66+
bundler-cache: true
67+
bundler: default
68+
ruby-version: ${{ matrix.ruby }}
69+
70+
- name: Prepare database
71+
run: |
72+
bin/rails db:create
73+
bin/rails db:migrate
74+
75+
- name: Get yarn cache directory path
76+
id: test-yarn-cache-dir-path
77+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
78+
79+
- uses: actions/cache@v4
80+
id: test-yarn-cache
81+
with:
82+
path: ${{ steps.test-yarn-cache-dir-path.outputs.dir }}
83+
key: ${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
84+
restore-keys: |
85+
${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
86+
87+
- name: Yarn install the dummy app
88+
run: |
89+
cd spec/dummy
90+
yarn
91+
92+
- name: Yarn install
93+
run: yarn
94+
95+
- name: Build assets
96+
env:
97+
RAILS_ENV: production
98+
NODE_ENV: production
99+
run: |
100+
yarn build:js
101+
yarn build:css
102+
yarn build:custom-js
103+
104+
- name: Run tests
105+
id: run_tests
106+
run: bundle exec rspec spec/features
107+
108+
- uses: actions/upload-artifact@v4
109+
with:
110+
name: coverage_features_${{ matrix.rails }}_ruby_${{ matrix.ruby }}
111+
path: coverage/.resultset.json
112+
113+
- uses: actions/upload-artifact@v4
114+
if: always() && steps.run_tests.outcome == 'failure'
115+
with:
116+
name: rspec_failed_screenshots_rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}
117+
path: |
118+
./spec/dummy/tmp/screenshots
119+
./spec/examples.txt
120+
121+
# ----------------------------------------------------------------------------
122+
# System specs (sharded)
123+
# ----------------------------------------------------------------------------
116124
system:
125+
name: system (Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}, ${{ matrix.spec_group.display }})
117126
strategy:
118127
matrix:
119128
ruby:
@@ -124,82 +133,87 @@ jobs:
124133
- '8.0'
125134
spec_group:
126135
- name: group_1
136+
display: Group 1
127137
rspec_path: spec/system/avo/group_1
128138
- name: group_2
139+
display: Group 2
129140
rspec_path: spec/system/avo/group_2
130141
- name: group_3
142+
display: Group 3
131143
rspec_path: spec/system/avo/group_3
132144
- name: group_4
145+
display: Group 4
133146
rspec_path: spec/system/avo/group_4
134147
runs-on: ubuntu-latest
135148

136149
env:
137-
RAILS_VERSION: ${{matrix.rails}}
150+
RAILS_VERSION: ${{ matrix.rails }}
138151
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}.gemfile
139152

140153
services:
141154
postgres:
142155
image: postgres:10.8
143-
ports: ["5432:5432"]
156+
ports:
157+
- 5432:5432
144158
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
145159

146160
steps:
147-
- uses: actions/checkout@v4
148-
149-
- name: Set up Ruby
150-
uses: ruby/setup-ruby@v1
151-
with:
152-
bundler-cache: true
153-
bundler: default
154-
ruby-version: ${{ matrix.ruby }}
155-
156-
- name: Prepare database
157-
run: |
158-
bin/rails db:create
159-
bin/rails db:migrate
160-
161-
- name: Get yarn cache directory path
162-
id: test-yarn-cache-dir-path
163-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
164-
165-
- uses: actions/cache@v4
166-
id: test-yarn-cache
167-
with:
168-
path: ${{ steps.test-yarn-cache-dir-path.outputs.dir }}
169-
key: ${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
170-
restore-keys: |
171-
${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
172-
173-
- name: Yarn install the dummy app
174-
run: |
175-
cd spec/dummy
176-
yarn
177-
178-
- name: Yarn install
179-
run: yarn
180-
181-
- name: Build assets
182-
env:
183-
RAILS_ENV: production
184-
NODE_ENV: production
185-
run: |
186-
yarn build:js
187-
yarn build:css
188-
yarn build:custom-js
189-
190-
- name: Run tests
191-
id: run_tests
192-
run: bundle exec rspec ${{ matrix.spec_group.rspec_path }} --tag=~i18n
193-
194-
- uses: actions/upload-artifact@v4
195-
with:
196-
name: coverage_system_${{ matrix.rails }}_ruby_${{ matrix.ruby }}_${{ matrix.spec_group.name }}
197-
path: coverage/.resultset.json
198-
199-
- uses: actions/upload-artifact@v4
200-
if: always() && steps.run_tests.outcome == 'failure'
201-
with:
202-
name: rspec_failed_screenshots_rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}_${{ matrix.spec_group.name }}
203-
path: |
204-
./spec/dummy/tmp/screenshots
205-
./spec/examples.txt
161+
- uses: actions/checkout@v4
162+
163+
- name: Set up Ruby
164+
uses: ruby/setup-ruby@v1
165+
with:
166+
bundler-cache: true
167+
bundler: default
168+
ruby-version: ${{ matrix.ruby }}
169+
170+
- name: Prepare database
171+
run: |
172+
bin/rails db:create
173+
bin/rails db:migrate
174+
175+
- name: Get yarn cache directory path
176+
id: test-yarn-cache-dir-path
177+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
178+
179+
- uses: actions/cache@v4
180+
id: test-yarn-cache
181+
with:
182+
path: ${{ steps.test-yarn-cache-dir-path.outputs.dir }}
183+
key: ${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
184+
restore-keys: |
185+
${{ runner.os }}-test-yarn-${{ hashFiles('**/yarn.lock') }}
186+
187+
- name: Yarn install the dummy app
188+
run: |
189+
cd spec/dummy
190+
yarn
191+
192+
- name: Yarn install
193+
run: yarn
194+
195+
- name: Build assets
196+
env:
197+
RAILS_ENV: production
198+
NODE_ENV: production
199+
run: |
200+
yarn build:js
201+
yarn build:css
202+
yarn build:custom-js
203+
204+
- name: Run tests
205+
id: run_tests
206+
run: bundle exec rspec ${{ matrix.spec_group.rspec_path }} --tag=~i18n
207+
208+
- uses: actions/upload-artifact@v4
209+
with:
210+
name: coverage_system_${{ matrix.rails }}_ruby_${{ matrix.ruby }}_${{ matrix.spec_group.name }}
211+
path: coverage/.resultset.json
212+
213+
- uses: actions/upload-artifact@v4
214+
if: always() && steps.run_tests.outcome == 'failure'
215+
with:
216+
name: rspec_failed_screenshots_rails_${{ matrix.rails }}_ruby_${{ matrix.ruby }}_${{ matrix.spec_group.name }}
217+
path: |
218+
./spec/dummy/tmp/screenshots
219+
./spec/examples.txt

0 commit comments

Comments
 (0)