Skip to content

Commit a637256

Browse files
authored
ci: modernize steps (#1789)
* Update ci.yml * Update CHANGELOG.md * adapt ci for node <10 * Update ci.yml * bump node-sass for node 16 compatibility * more chain bumps * Revert "more chain bumps" This reverts commit 89db4a9. * Revert "bump node-sass for node 16 compatibility" This reverts commit c3afc6e. * fix determine node major * fix determine node major * add docker * refactor docker * add madge for circular dependencies * run docker publish only on tag release * add ci check * changed default node vesion to 14 * Update ci.yml * Update ci.yml * fixed running ci self-check * changed default node to 16 * add docker builds * fix ci self-check * Update ci.yml * fix ci self-check * Update ciCheck.js * Update ci.yml * Update ci.yml * Update ci.yml * Update ci.yml * Update ci.yml * add node engine check * Update ci.yml * removed eol node envs * Update nodeEngineCheck.js
1 parent 0fe683a commit a637256

File tree

8 files changed

+2385
-116
lines changed

8 files changed

+2385
-116
lines changed

.github/workflows/ci.yml

+151-18
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,164 @@ on:
66
pull_request:
77
branches:
88
- '**'
9+
env:
10+
NODE_VERSION: 16.9.0
911
jobs:
12+
check-ci:
13+
name: CI Self-Check
14+
timeout-minutes: 15
15+
runs-on: ubuntu-18.04
16+
steps:
17+
- name: Determine major node version
18+
id: node
19+
run: |
20+
node_major=$(echo "${{ env.NODE_VERSION }}" | cut -d'.' -f1)
21+
echo "::set-output name=node_major::$(echo $node_major)"
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ env.NODE_VERSION }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ env.node-version }}
27+
- name: Cache Node.js modules
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.npm
31+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
34+
- name: Install dependencies
35+
run: npm ci
36+
- name: CI Environments Check
37+
run: npm run ci:check
38+
- name: CI Node Engine Check
39+
run: npm run ci:checkNodeEngine
1040
check-changelog:
1141
name: Changelog
1242
timeout-minutes: 5
1343
runs-on: ubuntu-18.04
1444
steps:
1545
- uses: actions/checkout@v2
1646
- uses: dangoslen/changelog-enforcer@v2
17-
build:
47+
# check-lint:
48+
# name: Lint
49+
# timeout-minutes: 15
50+
# runs-on: ubuntu-18.04
51+
# steps:
52+
# - uses: actions/checkout@v2
53+
# - name: Use Node.js ${{ env.NODE_VERSION }}
54+
# uses: actions/setup-node@v1
55+
# with:
56+
# node-version: ${{ env.node-version }}
57+
# - name: Cache Node.js modules
58+
# uses: actions/cache@v2
59+
# with:
60+
# path: ~/.npm
61+
# key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
62+
# restore-keys: |
63+
# ${{ runner.os }}-node-${{ env.NODE_VERSION }}-
64+
# - name: Install dependencies
65+
# run: npm ci
66+
# - run: npm run lint
67+
check-circular:
68+
name: Circular Dependencies
69+
timeout-minutes: 5
70+
runs-on: ubuntu-18.04
71+
steps:
72+
- uses: actions/checkout@v2
73+
- name: Use Node.js ${{ env.NODE_VERSION }}
74+
uses: actions/setup-node@v1
75+
with:
76+
node-version: ${{ env.node-version }}
77+
- name: Cache Node.js modules
78+
uses: actions/cache@v2
79+
with:
80+
path: ~/.npm
81+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
82+
restore-keys: |
83+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
84+
- name: Install dependencies
85+
run: npm ci
86+
- name: Scan for circular dependencies
87+
run: npm run madge:circular
88+
check-docker:
89+
strategy:
90+
matrix:
91+
include:
92+
- name: Docker linux/amd64
93+
DOCKER_PLATFORM: linux/amd64
94+
# Building currently fails for the platforms below
95+
# - name: Docker linux/arm/v6
96+
# DOCKER_PLATFORM: linux/arm/v6
97+
# - name: Docker linux/arm/v7
98+
# DOCKER_PLATFORM: linux/arm/v7
99+
# - name: Docker linux/arm64/v8
100+
# DOCKER_PLATFORM: linux/arm64/v8
101+
fail-fast: false
102+
name: ${{ matrix.name }}
103+
timeout-minutes: 15
18104
runs-on: ubuntu-18.04
19-
timeout-minutes: 30
20105
steps:
21-
- uses: actions/checkout@v2
22-
- name: Use Node.js
23-
uses: actions/setup-node@v1
24-
with:
25-
node-version: '10.14'
26-
- name: Cache Node.js modules
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.npm
30-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
31-
restore-keys: |
32-
${{ runner.os }}-node-
33-
- run: npm ci
34-
- run: ./scripts/before_script.sh
35-
env:
36-
CI: true
106+
- uses: actions/checkout@v2
107+
- name: Set up QEMU
108+
uses: docker/setup-qemu-action@v1
109+
- name: Set up Docker Buildx
110+
uses: docker/setup-buildx-action@v1
111+
- name: Build docker image
112+
uses: docker/build-push-action@v2
113+
with:
114+
platforms: ${{ matrix.DOCKER_PLATFORM }}
115+
check-lock-file-version:
116+
name: NPM Lock File Version
117+
timeout-minutes: 5
118+
runs-on: ubuntu-18.04
119+
steps:
120+
- uses: actions/checkout@v2
121+
- name: Check NPM lock file version
122+
uses: mansona/npm-lockfile-version@v1
123+
with:
124+
version: 1
125+
check-build:
126+
strategy:
127+
matrix:
128+
include:
129+
- name: Node 12
130+
NODE_VERSION: 12.22.6
131+
- name: Node 14
132+
NODE_VERSION: 14.17.6
133+
# Enable the following lines when Parse Dashboard reached Node 16 compatibility
134+
#- name: Node 16
135+
# NODE_VERSION: 16.9.0
136+
fail-fast: false
137+
name: ${{ matrix.name }}
138+
timeout-minutes: 15
139+
runs-on: ubuntu-18.04
140+
env:
141+
NODE_VERSION: ${{ matrix.NODE_VERSION }}
142+
steps:
143+
- name: Determine major node version
144+
id: node
145+
run: |
146+
node_major=$(echo "${{ matrix.NODE_VERSION }}" | cut -d'.' -f1)
147+
echo "::set-output name=node_major::$(echo $node_major)"
148+
- uses: actions/checkout@v2
149+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
150+
uses: actions/setup-node@v1
151+
with:
152+
node-version: ${{ matrix.NODE_VERSION }}
153+
- name: Cache Node.js modules
154+
uses: actions/cache@v2
155+
with:
156+
path: ~/.npm
157+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
158+
restore-keys: |
159+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
160+
- name: Install dependencies (Node < 10)
161+
run: npm install
162+
if: ${{ steps.node.outputs.node_major < 10 }}
163+
- name: Install dependencies (Node >= 10)
164+
run: npm ci
165+
if: ${{ steps.node.outputs.node_major >= 10 }}
166+
- name: Test bundles
167+
run: ./scripts/before_script.sh
168+
env:
169+
CI: true

.github/workflows/docker-publish.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: docker
22

33
on:
4-
schedule:
5-
# Nightly builds capture upstream updates to dependency images such as node.
6-
- cron: '19 17 * * *'
4+
# Disabled as we move to new branch model and plan to change the `latest` tag to mean "latest stable" instead of as currently "latest unstable"
5+
# schedule:
6+
# # Nightly builds capture upstream updates to dependency images such as node.
7+
# - cron: '19 17 * * *'
78
push:
8-
branches: [ master ]
9+
# Disabled as we move to new branch model and plan to change the `latest` tag to mean "latest stable" instead of as currently "latest unstable"
10+
# branches: [ master ]
911
tags: [ '*.*.*' ]
1012

1113
env:

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Fixed bug when opening a big modal, modal content is not visible due to Sidebar (Prerna Mehra) [#1777](https://github.com/parse-community/parse-dashboard/pull/1778)
1919
- Fixed UI for a field containing an array of pointers (Prerna Mehra) [#1776](https://github.com/parse-community/parse-dashboard/pull/1776)
2020
- Fixed bug when editing or copying a field containing an array of pointers [#1770](https://github.com/parse-community/parse-dashboard/issues/1770) (Prerna Mehra) [#1771](https://github.com/parse-community/parse-dashboard/pull/1771)
21+
- Modernize CI (Manuel Trezza) [#1789](https://github.com/parse-community/parse-dashboard/pull/1789)
2122

2223
# 2.2.0
2324
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/2.1.0...2.2.0)

0 commit comments

Comments
 (0)