Skip to content

Commit a16d5d7

Browse files
committed
ci: split CI workflows into manageable units
1 parent 628d8e1 commit a16d5d7

File tree

6 files changed

+190
-116
lines changed

6 files changed

+190
-116
lines changed

.github/workflows/coverage.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Coverage
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@master
13+
- uses: actions/setup-node@v1
14+
15+
- uses: actions/cache@v2
16+
name: retrieve npm cache
17+
with:
18+
path: ~/.npm
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-node-
22+
23+
- run: npm install
24+
25+
- name: run linter
26+
run: npm run lint
27+
28+
- name: build library
29+
run: npm run build -- --prod
30+
31+
- name: run library tests
32+
run: npm run test -- --coverage
33+
34+
- name: Upload coverage to Coveralls
35+
uses: coverallsapp/github-action@master
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/demo.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Demo
2+
on:
3+
push:
4+
branches:
5+
- demo
6+
tags:
7+
- v*
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@master
15+
- uses: actions/setup-node@v1
16+
17+
- uses: actions/cache@v2
18+
name: retrieve npm cache
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-node-
24+
25+
- run: npm install
26+
27+
- name: run linter
28+
run: npm run lint
29+
30+
- name: build library
31+
run: npm run build -- --prod
32+
33+
- name: run library tests
34+
run: npm run test
35+
36+
- name: run demo tests
37+
run: npm run test:demo
38+
39+
- name: build demo
40+
run: npm run build -- --prod --project=demo-app
41+
42+
- name: Deploy to Github Pages
43+
uses: JamesIves/github-pages-deploy-action@releases/v3
44+
with:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
BRANCH: gh-pages
47+
FOLDER: dist/demo-app

.github/workflows/deploy.yml

-116
This file was deleted.

.github/workflows/publish-v10.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish v10
2+
on:
3+
push:
4+
tags:
5+
- v10*
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@master
13+
- uses: actions/setup-node@v1
14+
15+
- uses: actions/cache@v2
16+
name: retrieve npm cache
17+
with:
18+
path: ~/.npm
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-node-
22+
- run: npm install
23+
24+
- name: run linter
25+
run: npm run lint
26+
27+
- name: build library
28+
run: npm run build -- --prod
29+
30+
- name: run library tests
31+
run: npm run test
32+
33+
- name: run demo tests
34+
run: npm run test:demo
35+
36+
- name: copy README and LICENSE
37+
run: |
38+
cp LICENSE dist/ngx-drawer-layout
39+
cp README.md dist/ngx-drawer-layout
40+
41+
- uses: actions/setup-node@master
42+
with:
43+
registry-url: 'https://registry.npmjs.org/'
44+
45+
- name: publish to npm
46+
working-directory: ./dist/ngx-drawer-layout
47+
run: npm publish
48+
env:
49+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/publish-v9.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish v9
2+
on:
3+
push:
4+
tags:
5+
- v9*
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@master
13+
- uses: actions/setup-node@v1
14+
15+
- uses: actions/cache@v2
16+
name: retrieve npm cache
17+
with:
18+
path: ~/.npm
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-node-
22+
- run: npm install
23+
24+
- name: run linter
25+
run: npm run lint
26+
27+
- name: build library
28+
run: npm run build -- --prod
29+
30+
- name: run library tests
31+
run: npm run test
32+
33+
- name: run demo tests
34+
run: npm run test:demo
35+
36+
- name: copy README and LICENSE
37+
run: |
38+
cp LICENSE dist/ngx-drawer-layout
39+
cp README.md dist/ngx-drawer-layout
40+
41+
- uses: actions/setup-node@master
42+
with:
43+
registry-url: 'https://registry.npmjs.org/'
44+
45+
- name: publish to npm
46+
working-directory: ./dist/ngx-drawer-layout
47+
run: npm publish --tag v9-lts
48+
env:
49+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Test
22
on:
3+
push:
4+
branches:
5+
- main
6+
- v*
7+
38
pull_request:
9+
branches:
10+
- main
11+
- v*
412

513
jobs:
614
test:

0 commit comments

Comments
 (0)