Skip to content

Commit 36c936e

Browse files
chore: Separate gh actions jobs (#5731)
1 parent 2009f20 commit 36c936e

File tree

1 file changed

+77
-19
lines changed

1 file changed

+77
-19
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,89 @@ on:
77
branches: [ development, master ]
88

99
jobs:
10-
build:
11-
10+
install:
11+
name: Install Dependencies
1212
runs-on: ubuntu-latest
13-
1413
steps:
1514
- uses: actions/checkout@v2
16-
- name: Use Node.js 14.x
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: 14.x
20-
- name: Get yarn cache path
21-
id: yarn-cache-path
22-
run: echo "::set-output name=dir::$(yarn cache dir)"
2315
- uses: actions/cache@v2
24-
id: yarn-cache
16+
id: cache
2517
with:
26-
path: ${{ steps.yarn-cache-path.outputs.dir }}
18+
path: node_modules
2719
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
2820
restore-keys: |
2921
${{ runner.os }}-yarn
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v1
24+
if: steps.cache.outputs.cache-hit != 'true'
25+
with:
26+
node-version: 14.x
3027
- run: yarn
31-
- run: touch .env
32-
- run: yarn l10n:generate
33-
- run: yarn lint
34-
- run: COVERAGE=true yarn test
35-
- run: ROOT_URL=open-event-frontend yarn build -prod
36-
- name: Code Coverage
37-
uses: codecov/codecov-action@v1
28+
if: steps.cache.outputs.cache-hit != 'true'
29+
30+
31+
lint:
32+
name: Lint
33+
needs: install
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
with:
38+
fetch-depth: 0
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v1
41+
with:
42+
node-version: 14.x
43+
- uses: actions/cache@v2
44+
id: cache
45+
with:
46+
path: node_modules
47+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48+
# no restore-keys here, so we only accept this exact version
49+
- run: yarn lint
50+
51+
52+
test:
53+
name: Test
54+
needs: install
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v2
58+
with:
59+
fetch-depth: 0
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v1
62+
with:
63+
node-version: 14.x
64+
- uses: actions/cache@v2
65+
id: cache
66+
with:
67+
path: node_modules
68+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69+
# no restore-keys here, so we only accept this exact version
70+
- run: yarn l10n:generate
71+
- run: COVERAGE=true yarn test
72+
- name: Code Coverage
73+
uses: codecov/codecov-action@v1
74+
75+
76+
build:
77+
name: Build
78+
needs: install
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v2
82+
with:
83+
fetch-depth: 0
84+
- name: Setup Node.js
85+
uses: actions/setup-node@v1
86+
with:
87+
node-version: 14.x
88+
- uses: actions/cache@v2
89+
id: cache
90+
with:
91+
path: node_modules
92+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
93+
# no restore-keys here, so we only accept this exact version
94+
- run: yarn l10n:generate
95+
- run: ROOT_URL=open-event-frontend yarn build -prod

0 commit comments

Comments
 (0)