OSDN Git Service

Regular updates
[twpd/master.git] / .github / workflows / build.yml
1 name: Build and test
2 on: push
3
4 jobs:
5   build:
6     runs-on: ubuntu-latest
7
8     steps:
9       - uses: actions/checkout@v2
10
11       # https://github.com/actions/cache/blob/master/examples.md#node---yarn
12       - name: "Cache: Get yarn cache directory path"
13         id: yarn-cache-dir-path
14         run: echo "::set-output name=dir::$(yarn cache dir)"
15
16       - name: "Cache: Set up yarn cache"
17         uses: actions/cache@v2
18         id: yarn-cache
19         with:
20           path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
21           key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22           restore-keys: |
23             ${{ runner.os }}-yarn-
24
25       # https://github.com/actions/cache/blob/master/examples.md#ruby---bundler
26       - name: "Cache: Set up bundler cache"
27         uses: actions/cache@v2
28         with:
29           path: vendor/bundle
30           key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
31           restore-keys: |
32             ${{ runner.os }}-gems-
33
34       - name: Use Node.js
35         uses: actions/setup-node@v1
36         with: { node-version: '12.x' }
37
38       - name: Use Ruby
39         uses: actions/setup-ruby@v1
40         with: { ruby-version: '2.7.1' }
41
42       - name: Setup dependencies
43         run: |
44           yarn --frozen-lockfile
45           bundle config path vendor/bundle
46           bundle install --jobs 4 --retry 3
47
48       - run: yarn build
49       - run: yarn test
50       - run: yarn test:smoke