Skip to content

Commit a695f37

Browse files
authored
Merge pull request #184 from alexandr-g/improvement/182
Parallelize GitHub actions execution with dependencies caching
2 parents defd767 + b258bc9 commit a695f37

File tree

1 file changed

+62
-21
lines changed

1 file changed

+62
-21
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,79 @@ name: CI
22

33
on: [push]
44

5+
env:
6+
NODE_VERSION: 12.x
7+
58
jobs:
6-
build:
9+
install:
710
runs-on: ubuntu-latest
811

9-
strategy:
10-
matrix:
11-
node-version: [10.x]
12-
1312
steps:
14-
- uses: actions/checkout@v2
15-
- name: Use Node.js ${{ matrix.node-version }}
13+
- name: CI
14+
uses: actions/checkout@v2
15+
- name: Use Node ${{ env.NODE_VERSION }}
1616
uses: actions/setup-node@v2
1717
with:
18-
node-version: ${{ matrix.node-version }}
19-
- name: install dependencies
20-
run: |
21-
yarn
22-
- name: run lint
23-
run: |
24-
yarn lint
25-
- name: run tests
26-
run: |
27-
yarn test --watchAll=false --coverage --reporters=default
18+
node-version: ${{ env.NODE_VERSION }}
19+
- uses: actions/cache@v2
20+
with:
21+
path: '**/node_modules'
22+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
23+
- name: Install dependencies
24+
run: yarn install --frozen-lockfile
25+
env:
26+
CI: true
27+
28+
lint:
29+
runs-on: ubuntu-latest
30+
needs: [install]
31+
32+
steps:
33+
- name: Running lint
34+
uses: actions/checkout@v2
35+
- uses: actions/cache@v2
36+
with:
37+
path: '**/node_modules'
38+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
39+
- name: Lint
40+
run: yarn lint
41+
env:
42+
CI: true
43+
44+
test:
45+
runs-on: ubuntu-latest
46+
needs: [install]
47+
48+
steps:
49+
- name: Running tests
50+
uses: actions/checkout@v2
51+
- uses: actions/cache@v2
52+
with:
53+
path: '**/node_modules'
54+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
55+
- name: Test
56+
run: yarn test --coverage --reporters=default
2857
- name: Upload coverage to Codecov
2958
uses: codecov/[email protected]
3059
with:
3160
token: ${{ secrets.CODECOV_TOKEN }}
32-
- name: build
33-
run: |
34-
yarn build
61+
env:
62+
CI: true
3563

36-
- name: semantic release
64+
build:
65+
runs-on: ubuntu-latest
66+
needs: [install]
67+
68+
steps:
69+
- name: Build
70+
uses: actions/checkout@v2
71+
- uses: actions/cache@v2
72+
with:
73+
path: '**/node_modules'
74+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
75+
- name: Build
76+
run: yarn build
77+
- name: Release
3778
uses: cycjimmy/semantic-release-action@v2
3879
id: semantic
3980
with:

0 commit comments

Comments
 (0)