-
Notifications
You must be signed in to change notification settings - Fork 52
138 lines (136 loc) · 3.96 KB
/
build.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: build
on:
pull_request: ~
push:
branches: [main]
tags: ['v*']
paths-ignore:
- 'docs/**'
jobs:
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
id: cache
with:
path: |
node_modules
*/*/node_modules
key: ${{ matrix.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn test:unit
env:
SANDBOX_TOKEN: ${{ secrets.API_HUB_SANDBOX_TOKEN }}
- run: yarn test:integration
- run: yarn test:type
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: actions/cache@v2
id: cache
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn lint
name: Static Code Check
- run: yarn check:test-service
name: Test Service Version Check
- run: yarn check:dependencies
name: Undeclared dependency Check
- run: yarn check:circular
name: Circular dependency Check
- run: yarn doc
name: API Doc Check
- run: yarn check:license
name: License Check
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1.1
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: actions/cache@v2
id: cache
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn test:e2e
canary-release:
if: github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [tests, checks]
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: actions/cache@v2
id: cache
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- name: Canary Release
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
date=`date +%Y%m%d%H%M%S`
yarn lerna publish --canary --no-push --no-git-tag-version --dist-tag canary --force-publish --preid ${date} -y
env:
NPM_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
draft-github-release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [tests, checks]
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: actions/cache@v2
id: cache
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/get-changelog
name: Get Changelog
id: get-changelog
- uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
body: ${{ steps.get-changelog.outputs.changelog }}