Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: prerequisites Node.js >= 16.0.0 and npm >= 8.0.0 #322

Merged
merged 1 commit into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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