-
-
Notifications
You must be signed in to change notification settings - Fork 45
105 lines (103 loc) · 2.86 KB
/
CI.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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install project dependencies
run: npm i
- name: Build atft library
run: npx ng build atft
- name: Build prod
run: npx ng build --configuration "production" --base-href "https://makimenko.github.io/angular-template-for-threejs/demo/" --output-path ./dist/gh-pages-deploy/demo
- name: Upload build
uses: actions/upload-artifact@v1
with:
name: demo
path: ./dist/gh-pages-deploy
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install project dependencies
run: npm i
- name: Build atft library
run: npx ng build atft
- name: Test
run: |
sudo apt-get update
sudo apt-get install -y xvfb
Xvfb :99 &
export DISPLAY=:99
npx ng test --watch=false --code-coverage
- name: Code coverage
run: npx codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install project dependencies
run: npm i
- name: Lint
run: npx ng lint
storybook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install project dependencies
run: npm i
- name: Build atft library
run: npx ng build atft
- name: Build storybook
run: npx ng run angular-template-for-threejs:build-storybook:production
- name: Upload storybook
uses: actions/upload-artifact@v1
with:
name: storybook
path: ./dist/gh-pages-deploy
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install project dependencies
run: npm i
- name: Generate documentation
run: npx compodoc -p projects/atft/tsconfig.lib.json -d dist/gh-pages-deploy
- name: Upload doc
uses: actions/upload-artifact@v1
with:
name: doc
path: ./dist/gh-pages-deploy
publish:
runs-on: ubuntu-latest
needs: [demo, test, storybook, doc, lint]
if: github.ref == 'refs/heads/master'
steps:
- name: Download demo
uses: actions/download-artifact@v1
with:
name: demo
path: dist
- name: Download storybook
uses: actions/download-artifact@v1
with:
name: storybook
path: dist
- name: Download doc
uses: actions/download-artifact@v1
with:
name: doc
path: dist
- name: Deploy
uses: peaceiris/[email protected]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist