-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
169 lines (169 loc) · 5.28 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- '**'
env:
NODE_VERSION: 16.9.0
jobs:
check-ci:
name: CI Self-Check
timeout-minutes: 15
runs-on: ubuntu-18.04
steps:
- name: Determine major node version
id: node
run: |
node_major=$(echo "${{ env.NODE_VERSION }}" | cut -d'.' -f1)
echo "::set-output name=node_major::$(echo $node_major)"
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
- name: CI Environments Check
run: npm run ci:check
- name: CI Node Engine Check
run: npm run ci:checkNodeEngine
check-changelog:
name: Changelog
timeout-minutes: 5
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: dangoslen/changelog-enforcer@v2
# check-lint:
# name: Lint
# timeout-minutes: 15
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ env.NODE_VERSION }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ env.node-version }}
# - name: Cache Node.js modules
# uses: actions/cache@v2
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-${{ env.NODE_VERSION }}-
# - name: Install dependencies
# run: npm ci
# - run: npm run lint
check-circular:
name: Circular Dependencies
timeout-minutes: 5
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
- name: Scan for circular dependencies
run: npm run madge:circular
check-docker:
strategy:
matrix:
include:
- name: Docker linux/amd64
DOCKER_PLATFORM: linux/amd64
# Building currently fails for the platforms below
# - name: Docker linux/arm/v6
# DOCKER_PLATFORM: linux/arm/v6
# - name: Docker linux/arm/v7
# DOCKER_PLATFORM: linux/arm/v7
# - name: Docker linux/arm64/v8
# DOCKER_PLATFORM: linux/arm64/v8
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build docker image
uses: docker/build-push-action@v2
with:
platforms: ${{ matrix.DOCKER_PLATFORM }}
check-lock-file-version:
name: NPM Lock File Version
timeout-minutes: 5
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Check NPM lock file version
uses: mansona/npm-lockfile-version@v1
with:
version: 1
check-build:
strategy:
matrix:
include:
- name: Node 12
NODE_VERSION: 12.22.6
- name: Node 14
NODE_VERSION: 14.17.6
# Enable the following lines when Parse Dashboard reached Node 16 compatibility
#- name: Node 16
# NODE_VERSION: 16.9.0
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
runs-on: ubuntu-18.04
env:
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- name: Determine major node version
id: node
run: |
node_major=$(echo "${{ matrix.NODE_VERSION }}" | cut -d'.' -f1)
echo "::set-output name=node_major::$(echo $node_major)"
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.NODE_VERSION }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
- name: Install dependencies (Node < 10)
run: npm install
if: ${{ steps.node.outputs.node_major < 10 }}
- name: Install dependencies (Node >= 10)
run: npm ci
if: ${{ steps.node.outputs.node_major >= 10 }}
- name: Test bundles
run: ./scripts/before_script.sh
env:
CI: true