This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (116 loc) · 3.75 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# This workflow will do a clean install of node dependencies,
# build the source code and run tests across different versions of node
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# Note: "jq" is installed by default on github runners
name: CI
on:
workflow_dispatch:
push:
branches: [ main ]
paths-ignore: ['README.md', 'LICENSE']
pull_request:
branches: [ main ]
paths-ignore: ['README.md', 'LICENSE']
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm clean-install --progress=false --no-fund
- name: Build
run: npm run build
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm clean-install --progress=false --no-fund
- name: Lint
run: npm run lint
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout template code
uses: actions/checkout@v4
with:
repository: playcanvas/playcanvas-jsdoc-template
path: ./playcanvas-jsdoc-template
- name: Checkout engine code
uses: actions/checkout@v4
with:
repository: playcanvas/engine
path: ./engine
- name: Show working directory with both repos
run: ls -al
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install updated template dependencies
run: npm clean-install --progress=false --no-fund
working-directory: ./playcanvas-jsdoc-template
- name: Build updated template
run: npm run build
working-directory: ./playcanvas-jsdoc-template
- name: Install engine dependencies
run: npm clean-install --progress=false --no-fund
working-directory: ./engine
- name: Read origional conf-api.json
run: cat ./conf-api.json
working-directory: ./engine
- name: Confirm current template works
run: npm run docs
working-directory: ./engine
- name: Show docs directory
run: ls ./docs/
working-directory: ./engine
- name: Clear docs directory
run: rm -rf ./docs/
working-directory: ./engine
- name: Rename original config file
run: mv conf-api.json conf-api.orig
working-directory: ./engine
- name: Point engine conf-api.json to updated template
run: jq '.opts.template=$tmpl' --arg tmpl "../playcanvas-jsdoc-template" conf-api.orig > conf-api.json
working-directory: ./engine
- name: Read modified conf-api.json
run: cat ./conf-api.json
working-directory: ./engine
- name: Build PlayCanvas API Reference with updated template
run: npm run docs
working-directory: ./engine
- name: Show docs directory
run: ls ./docs/
working-directory: ./engine