Skip to content

Commit

Permalink
refactor: prerequisites Node.js >= 16.0.0 and npm >= 8.0.0 (#322)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: minimum supported Node.js v16.0.0 and npm v8.0.0
  • Loading branch information
theoludwig authored Nov 7, 2021
1 parent cf6d7d0 commit 2f66f1c
Show file tree
Hide file tree
Showing 7 changed files with 21,962 additions and 4,213 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ on:

jobs:
build:

runs-on: ubuntu-20.04
container: leonai/ci:latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
- name: Use Python
uses: actions/setup-python@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Cache Pipenv
uses: actions/cache@v2
python-version: 3.x

- name: Use Node.js
uses: actions/setup-node@v2
with:
path: ./bridges/python/.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pip-
node-version: 16.x
cache: npm

- name: Install Pipenv
run: pip install --upgrade pip && pip install pipenv

- name: Install
run: npm ci
run: npm install

- name: Check setup
run: npm run check
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ on:

jobs:
lint:

runs-on: ubuntu-20.04
container: leonai/ci:latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
- name: Use Python
uses: actions/setup-python@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Cache Pipenv
uses: actions/cache@v2
python-version: 3.x

- name: Use Node.js
uses: actions/setup-node@v2
with:
path: ./bridges/python/.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pip-
node-version: 16.x
cache: npm

- name: Install Pipenv
run: pip install --upgrade pip && pip install pipenv

- name: Install
run: npm ci
run: npm install

- name: Run linter
run: npm run lint
30 changes: 15 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ on:

jobs:
tests:

runs-on: ubuntu-20.04
container: leonai/ci:latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node_modules
uses: actions/cache@v2
- name: Use Python
uses: actions/setup-python@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Cache Pipenv
uses: actions/cache@v2
python-version: 3.x

- name: Use Node.js
uses: actions/setup-node@v2
with:
path: ./bridges/python/.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install npm dependencies
run: npm ci
node-version: 16.x
cache: npm

- name: Install Pipenv
run: pip install --upgrade pip && pip install pipenv

- name: Install
run: npm install

- name: Run JSON tests
run: npm run test:json
Expand Down
17 changes: 6 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
FROM node:14-alpine
FROM node:16-alpine
ENV IS_DOCKER true
WORKDIR /app

# Install system packages
RUN apk add --no-cache --no-progress \
ca-certificates \
python3 \
git \
tzdata
ca-certificates \
py3-pip \
git \
tzdata

# Upgrade pip and install Pipenv
RUN pip3 install --no-cache-dir --progress-bar off pipenv

# Install Leon
# Need to explicitly run the npm preinstall and npm posinstall scripts (not needed with npm@7)
# because npm tries to downgrade its privileges, and these scripts are not executed
COPY ./package*.json ./
RUN npm clean-install
COPY ./ ./
RUN npm run preinstall
RUN npm run postinstall
RUN npm install
RUN npm run build

CMD ["npm", "start"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ Gitpod will automatically setup an environment and run an instance for you.

### Prerequisites

- [Node.js](https://nodejs.org/) >= 14
- [npm](https://npmjs.com/) >= 5
- [Node.js](https://nodejs.org/) >= 16
- [npm](https://npmjs.com/) >= 8
- [Python](https://www.python.org/downloads/) >= 3
- [Pipenv](https://docs.pipenv.org) >= 2020.11.15
- Supported OSes: Linux, macOS and Windows
Expand Down
Loading

0 comments on commit 2f66f1c

Please sign in to comment.