Skip to content

Commit

Permalink
Upgrade to Node 14 (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles authored Mar 18, 2021
1 parent 0cac74b commit 537be24
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
- name: 📦 Install NPM front packages
Expand Down
63 changes: 22 additions & 41 deletions .github/workflows/docker-master-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,55 @@ name: Master branch tests

on:
push:
branches: [ master ]
branches: [master]

jobs:
test-front:
name: Front test
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
- name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
-
name: 💽 Setup nodejs
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: 📇 Use npm cache
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: 📦 Install Global NPM Packages
- name: 📦 Install Global NPM Packages
run: |
sudo npm install typescript node-gyp npm@latest -g
-
name: 📦 Install NPM front packages
- name: 📦 Install NPM front packages
working-directory: ./front
run: |
npm ci
-
name: 🧐 Prettier check
- name: 🧐 Prettier check
working-directory: ./front
run: |
npm run prettier-check
-
name: 👕 ESlint
- name: 👕 ESlint
working-directory: ./front
run: |
npm run eslint
-
name: 🌐 Integration comparison
- name: 🌐 Integration comparison
working-directory: ./front
run: |
npm run compare-translations
test-server:
name: Server test
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
- name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
with:
fetch-depth: 2
-
name: 💽 Setup nodejs
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: 📇 Use npm cache
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: 🖥️ Setup OZW
- name: 🖥️ Setup OZW
run: |
docker create -ti --name dummy chrisns/openzwave:ubuntu-1.6.1714 bash
sudo docker cp dummy:/usr/local/include/openzwave /usr/local/include/openzwave
Expand All @@ -71,35 +59,28 @@ jobs:
sudo docker cp dummy:/openzwave/config /usr/local/etc/openzwave
sudo ldconfig
docker rm -f dummy
-
name: 💽 Install System Dependencies
- name: 💽 Install System Dependencies
run: |
sudo apt update
sudo apt-get install -y libudev-dev sqlite3 openssl python-is-python3
-
name: 📦 Install Global NPM Packages
- name: 📦 Install Global NPM Packages
run: |
sudo npm install typescript node-gyp npm@latest -g
-
name: 📦 Install NPM server packages
- name: 📦 Install NPM server packages
working-directory: ./server
run: |
npm ci
-
name: 🧐 Prettier check
- name: 🧐 Prettier check
working-directory: ./server
run: |
npm run prettier-check
-
name: 👕 ESlint
- name: 👕 ESlint
working-directory: ./server
run: |
npm run eslint
-
name: ✅ Test with coverage
- name: ✅ Test with coverage
working-directory: ./server
run: |
npm run coverage
-
name: 📄 Codecov report upload
- name: 📄 Codecov report upload
uses: codecov/codecov-action@v1
98 changes: 34 additions & 64 deletions .github/workflows/docker-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,56 @@ name: Pull request tests

on:
pull_request:
branches: [ master ]
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]

jobs:
test-front:
name: Front test
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
- name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
-
name: 💽 Setup nodejs
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: 📇 Use npm cache
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: 📦 Install Global NPM Packages
- name: 📦 Install Global NPM Packages
run: |
sudo npm install typescript node-gyp npm@latest -g
-
name: 📦 Install NPM front packages
- name: 📦 Install NPM front packages
working-directory: ./front
run: |
npm ci
-
name: 🧐 Prettier check
- name: 🧐 Prettier check
working-directory: ./front
run: |
npm run prettier-check
-
name: 👕 ESlint
- name: 👕 ESlint
working-directory: ./front
run: |
npm run eslint
-
name: 🌐 Integration comparison
- name: 🌐 Integration comparison
working-directory: ./front
run: |
npm run compare-translations
test-server:
name: Server test
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
- name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
with:
fetch-depth: 2
-
name: 💽 Setup nodejs
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: 📇 Use npm cache
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: 🖥️ Setup OZW
- name: 🖥️ Setup OZW
run: |
docker create -ti --name dummy chrisns/openzwave:ubuntu-1.6.1714 bash
sudo docker cp dummy:/usr/local/include/openzwave /usr/local/include/openzwave
Expand All @@ -72,37 +60,30 @@ jobs:
sudo docker cp dummy:/openzwave/config /usr/local/etc/openzwave
sudo ldconfig
docker rm -f dummy
-
name: 💽 Install System Dependencies
- name: 💽 Install System Dependencies
run: |
sudo apt update
sudo apt-get install -y libudev-dev sqlite3 openssl python-is-python3
-
name: 📦 Install Global NPM Packages
- name: 📦 Install Global NPM Packages
run: |
sudo npm install typescript node-gyp npm@latest -g
-
name: 📦 Install NPM server packages
- name: 📦 Install NPM server packages
working-directory: ./server
run: |
npm ci
-
name: 🧐 Prettier check
- name: 🧐 Prettier check
working-directory: ./server
run: |
npm run prettier-check
-
name: 👕 ESlint
- name: 👕 ESlint
working-directory: ./server
run: |
npm run eslint
-
name: ✅ Test with coverage
- name: ✅ Test with coverage
working-directory: ./server
run: |
npm run coverage
-
name: 📄 Codecov report upload
- name: 📄 Codecov report upload
uses: codecov/codecov-action@v1
build-front:
if: github.event.pull_request.draft == false
Expand All @@ -112,29 +93,23 @@ jobs:
- test-server
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout code
- name: ⬇️ Checkout code
uses: actions/checkout@v2
-
name: 💽 Setup nodejs
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: 📇 Use npm cache
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: 📦 Install NPM front packages
- name: 📦 Install NPM front packages
working-directory: ./front
run: |
npm ci
-
name: 🏗️ Build front
- name: 🏗️ Build front
working-directory: ./front
run: |
npm run build
-
name: ↗️ Upload build artifact
- name: ↗️ Upload build artifact
uses: actions/upload-artifact@v2
with:
name: static
Expand All @@ -145,26 +120,21 @@ jobs:
name: Docker magic !
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout code
- name: ⬇️ Checkout code
uses: actions/checkout@v2
-
name: 💽 Set up QEMU
- name: 💽 Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: 🐳 Set up Docker Buildx
- name: 🐳 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
-
name: ↙️ Download build artifact
- name: ↙️ Download build artifact
uses: actions/download-artifact@v2
with:
name: static
path: static
-
name: 🐳 Build AMD64 images
- name: 🐳 Build AMD64 images
uses: docker/build-push-action@v2
with:
context: .
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
- name: 📦 Install Global NPM Packages
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
- name: 🖥️ Setup OZW
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: 💽 Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
node-version: '14'
- name: 📇 Use npm cache
uses: c-hive/gha-npm-cache@v1
- name: 📦 Install NPM front packages
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG TARGET
ARG VERSION
ARG BUILD_DATE

FROM $TARGET/node:12-alpine
FROM $TARGET/node:14-alpine

LABEL \
org.label-schema.build-date=$BUILD_DATE \
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.buildx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM chrisns/openzwave:alpine-1.6.1714 as ozw

# STEP 2
# Prepare server package*.json files
FROM node:12-alpine as json-files
FROM node:14-alpine as json-files
COPY ./server /json-files/server
WORKDIR /json-files/server/
RUN find . -type f \! -name "package*.json" -exec rm -r {} \;
Expand All @@ -15,7 +15,7 @@ COPY ./server/utils /json-files/server/utils

# STEP 3
# Gladys Bundle
FROM node:12-alpine as gladys
FROM node:14-alpine as gladys

# System dependencies
RUN apk add --no-cache \
Expand Down
Loading

0 comments on commit 537be24

Please sign in to comment.