This repository has been archived by the owner on May 25, 2024. It is now read-only.
forked from Tokyo-Metro-Gov/covid19
-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (64 loc) · 2 KB
/
on_pr_to_dev_rspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: on_pr_to_dev_rspec
on:
pull_request:
branches:
- development
jobs:
rspec:
runs-on: ubuntu-20.04
steps:
- name: Setup Timezone
run: |
sudo timedatectl set-timezone Asia/Tokyo
- uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.17.1'
- name: restore node_modules
uses: actions/cache@v3
id: node-modules-cache
with:
path: |
node_modules
**/node_modules
key: ${{ runner.os }}-node-16-node_modules-${{ hashFiles('yarn.lock') }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}
- name: yarn install
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2'
bundler-cache: true
- name: yarn run generate:deploy for rspec
run: |
yarn run generate:deploy --fail-on-page-error
env:
TZ: Asia/Tokyo
- name: run localhost:3000
run: |
yarn run start &
- name: rspec
run: |
bundle exec rspec spec/feature/index/shared/index_h1h2_spec.rb
bundle exec rspec spec/feature/check_broken_links_spec.rb
- name: upload rspec screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: rspec-screenshots
path: spec/screenshot
retention-days: 3