Skip to content

Commit 8d83256

Browse files
committed
build(platform): add build file and cz-commit
1 parent 200334f commit 8d83256

File tree

3 files changed

+440
-22
lines changed

3 files changed

+440
-22
lines changed

.github/workflows/build.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: CI Checks
2+
on:
3+
pull_request:
4+
branches: [master]
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
setup:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest]
14+
node-version: [12.x]
15+
steps:
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 3
23+
- name: Get origin master
24+
run: |
25+
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
26+
- uses: actions/cache@v1
27+
id: workspace-cache
28+
with:
29+
path: node_modules
30+
key: ${{ runner.os }}-${{ matrix.node-version }}-workspace-${{ hashFiles('**/yarn.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-${{ matrix.node-version }}-workspace-
33+
- name: Install Dependencies
34+
run: yarn install --frozen-lockfile
35+
lint:
36+
runs-on: ${{ matrix.os }}
37+
38+
needs: [setup]
39+
strategy:
40+
matrix:
41+
os: [ubuntu-latest, windows-latest]
42+
node-version: [12.x]
43+
44+
steps:
45+
- name: Use Node.js ${{ matrix.node-version }}
46+
uses: actions/setup-node@v1
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
- uses: actions/checkout@v2
50+
with:
51+
fetch-depth: 3
52+
- name: Get origin master
53+
if: github.event_name == 'pull_request'
54+
run: |
55+
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
56+
- uses: actions/cache@v1
57+
id: workspace-cache
58+
with:
59+
path: node_modules
60+
key: ${{ runner.os }}-${{ matrix.node-version }}-workspace-${{ hashFiles('**/yarn.lock') }}
61+
restore-keys: |
62+
${{ runner.os }}-${{ matrix.node-version }}-workspace-
63+
- name: Run On Master (Linux)
64+
if: github.event_name == 'push' && runner.os == 'Linux'
65+
run: yarn affected:lint --base=$GITHUB_REF~1 --head=$GITHUB_SHA --parallel
66+
- name: Run On Master (Windows)
67+
if: github.event_name == 'push' && runner.os == 'Windows'
68+
run: yarn affected:lint --base=${env:GITHUB_REF}~1 --head=${env:GITHUB_SHA} --parallel
69+
- name: Run on PR
70+
if: github.event_name == 'pull_request'
71+
run: yarn affected:lint --base=origin/master --head=HEAD --parallel
72+
73+
build:
74+
runs-on: ${{ matrix.os }}
75+
76+
needs: [setup]
77+
78+
strategy:
79+
matrix:
80+
os: [ubuntu-latest, windows-latest]
81+
node-version: [12.x]
82+
83+
steps:
84+
- name: Use Node.js ${{ matrix.node-version }}
85+
uses: actions/setup-node@v1
86+
with:
87+
node-version: ${{ matrix.node-version }}
88+
- uses: actions/checkout@v2
89+
with:
90+
fetch-depth: 3
91+
- name: Get origin master
92+
if: github.event_name == 'pull_request'
93+
run: |
94+
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
95+
- uses: actions/cache@v1
96+
id: workspace-cache
97+
with:
98+
path: node_modules
99+
key: ${{ runner.os }}-${{ matrix.node-version }}-workspace-${{ hashFiles('**/yarn.lock') }}
100+
restore-keys: |
101+
${{ runner.os }}-${{ matrix.node-version }}-workspace-
102+
- name: Run On Master (Linux)
103+
if: github.event_name == 'push' && runner.os == 'Linux'
104+
run: yarn affected:build --base=$GITHUB_REF~1 --head=$GITHUB_SHA --parallel
105+
- name: Run On Master (Windows)
106+
if: github.event_name == 'push' && runner.os == 'Windows'
107+
run: yarn affected:build --base=${env:GITHUB_REF}~1 --head=${env:GITHUB_SHA} --parallel
108+
- name: Run on PR
109+
if: github.event_name == 'pull_request'
110+
run: yarn affected:build --base=origin/master --head=HEAD --parallel
111+
112+
test:
113+
runs-on: ${{ matrix.os }}
114+
115+
needs: [setup]
116+
117+
strategy:
118+
matrix:
119+
os: [ubuntu-latest, windows-latest]
120+
node-version: [12.x]
121+
122+
steps:
123+
- name: Use Node.js ${{ matrix.node-version }}
124+
uses: actions/setup-node@v1
125+
with:
126+
node-version: ${{ matrix.node-version }}
127+
- uses: actions/checkout@v2
128+
with:
129+
fetch-depth: 3
130+
- name: Get origin master
131+
if: github.event_name == 'pull_request'
132+
run: |
133+
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
134+
- uses: actions/cache@v1
135+
id: workspace-cache
136+
with:
137+
path: node_modules
138+
key: ${{ runner.os }}-${{ matrix.node-version }}-workspace-${{ hashFiles('**/yarn.lock') }}
139+
restore-keys: |
140+
${{ runner.os }}-${{ matrix.node-version }}-workspace-
141+
- name: Run On Master (Linux)
142+
if: github.event_name == 'push' && runner.os == 'Linux'
143+
run: yarn affected:test --base=$GITHUB_REF~1 --head=$GITHUB_SHA --parallel
144+
- name: Run On Master (Windows)
145+
if: github.event_name == 'push' && runner.os == 'Windows'
146+
run: yarn affected:test --base=${env:GITHUB_REF}~1 --head=${env:GITHUB_SHA} --parallel
147+
- name: Run on PR
148+
if: github.event_name == 'pull_request'
149+
run: yarn affected:test --base=origin/master --head=HEAD --parallel

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"update": "nx migrate latest",
2424
"workspace-schematic": "nx workspace-schematic",
2525
"dep-graph": "nx dep-graph",
26-
"help": "nx help"
26+
"help": "nx help",
27+
"commit": "git-cz"
2728
},
2829
"private": true,
2930
"dependencies": {
@@ -45,6 +46,7 @@
4546
"@types/node": "~8.9.4",
4647
"@typescript-eslint/eslint-plugin": "2.19.2",
4748
"@typescript-eslint/parser": "2.19.2",
49+
"cz-conventional-changelog": "^3.3.0",
4850
"dotenv": "6.2.0",
4951
"eslint": "6.8.0",
5052
"eslint-config-prettier": "6.11.0",
@@ -56,5 +58,10 @@
5658
"ts-node": "~7.0.0",
5759
"tslint": "~6.1.3",
5860
"typescript": "~3.9.3"
61+
},
62+
"config": {
63+
"commitizen": {
64+
"path": "./node_modules/cz-conventional-changelog"
65+
}
5966
}
6067
}

0 commit comments

Comments
 (0)