Skip to content

Commit 44fef92

Browse files
committed
multiple jobs
1 parent 0dca7d3 commit 44fef92

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.github/workflows/main.yml

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
73
on:
84
push:
95
branches: [ master ]
106
pull_request:
117
branches: [ master ]
128

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
149
jobs:
15-
# This workflow contains a single job called "build"
16-
test:
17-
# The type of runner that the job will run on
10+
install-deps:
1811
runs-on: ubuntu-latest
19-
20-
# Steps represent a sequence of tasks that will be executed as part of the job
2112
steps:
2213
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2314
- uses: actions/checkout@v2
2415
# Sets up node environment specified in .nvmrc
2516
- uses: actions/setup-node@v2-beta
2617
with:
2718
node-version: '15.0.1'
19+
# Restores cache, so every time yarn install didn't do the same thing
2820
- name: Cache multiple paths
2921
uses: actions/cache@v2
3022
with:
@@ -35,12 +27,27 @@ jobs:
3527
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
3628
- name: install npm dependencies
3729
run: yarn config set cache-folder `pwd`/yarn-cache && yarn install --frozen-lockfile
30+
build:
31+
needs: [install-deps]
32+
runs-on: ubuntu-latest
33+
steps:
3834
- name: build
3935
run: yarn run build:test
36+
lint:
37+
needs: [install-deps]
38+
runs-on: ubuntu-latest
39+
steps:
4040
- name: eslint
4141
run: yarn run lint
42+
test:
43+
needs: [build]
44+
runs-on: ubuntu-latest
45+
steps:
4246
- name: test
4347
run: yarn run test:cypress:run:report
48+
coverage:
49+
needs: [test]
50+
runs-on: ubuntu-latest
51+
steps:
4452
- name: coverage
45-
run: yarn run test:coverage
46-
53+
run: yarn run test:coverage

0 commit comments

Comments
 (0)