This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (94 loc) · 3.35 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
- push
jobs:
test:
runs-on: ubuntu-latest
steps:
# Setup environment and checkout the project master
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
scope: "@superfaceai"
node-version: "14"
- name: Checkout
uses: actions/[email protected]
# Setup yarn cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Install and run tests
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Test
run: yarn test --bail
lint:
runs-on: ubuntu-latest
steps:
# Setup environment and checkout the project master
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
scope: "@superfaceai"
node-version: "14"
- name: Checkout
uses: actions/[email protected]
# Setup yarn cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Install and run lint
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint
license-check:
runs-on: ubuntu-latest
steps:
# Setup environment and checkout the project master
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
scope: "@superfaceai"
node-version: "14"
- name: Checkout
uses: actions/[email protected]
# Setup yarn cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/[email protected]
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Install and run license checker
- name: Install dependencies
run: yarn install
- name: Install License checker
run: |
yarn global add license-checker
echo "$(yarn global bin)" >> $GITHUB_PATH
- name: Check licenses
run: "license-checker --onlyAllow '0BDS;MIT;Apache-2.0;ISC;BSD-3-Clause;BSD-2-Clause;CC-BY-4.0;CC-BY-3.0;BSD;CC0-1.0;Unlicense' --summary"