Skip to content

Commit

Permalink
Merge pull request #2508 from snyk/chore/dev-node16
Browse files Browse the repository at this point in the history
feat: build binaries with node@16
  • Loading branch information
Jahed Ahmed committed Jan 24, 2022
2 parents fd027f6 + d2fd763 commit 9cd65c6
Show file tree
Hide file tree
Showing 15 changed files with 260 additions and 285 deletions.
23 changes: 17 additions & 6 deletions .circleci/config.yml
Expand Up @@ -9,7 +9,10 @@ defaults: &defaults
parameters:
node_version:
type: string
default: '14.17.5'
default: '16.13.2'
npm_version:
type: string
default: '8.1.2'
working_directory: /mnt/ramdisk/snyk

commands:
Expand All @@ -19,7 +22,6 @@ commands:
type: string
npm_version:
type: string
default: '7.21.1'
npm_cache_directory:
type: string
default: /mnt/ramdisk/.npm
Expand Down Expand Up @@ -158,6 +160,7 @@ jobs:
- checkout
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
npm_install: true
- persist_to_workspace:
root: .
Expand All @@ -174,19 +177,21 @@ jobs:
at: .
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Linting project
command: npm run lint
build:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
- image: cimg/node:<< parameters.node_version >>
steps:
- checkout
- attach_workspace:
at: .
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Building project
command: npm run build:prod
Expand All @@ -208,6 +213,7 @@ jobs:
- install_shellspec_dependencies
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Installing test fixture dependencies
working_directory: ./test/fixtures/basic-npm
Expand Down Expand Up @@ -243,10 +249,11 @@ jobs:
node_version: << parameters.node_version >>
- install_sdks_windows
- setup_npm:
npm_cache_directory: ~\AppData\Local\npm-cache
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
npm_global_sudo: false
npm_install: true # reinstalling as workspace node_modules is for linux
npm_cache_directory: ~\AppData\Local\npm-cache
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=$env:SNYK_API_KEY"
Expand Down Expand Up @@ -291,6 +298,7 @@ jobs:
- install_sdks_linux
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
Expand Down Expand Up @@ -327,6 +335,7 @@ jobs:
- install_sdks_linux
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
Expand All @@ -347,6 +356,7 @@ jobs:
- install_release_dependencies
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Updating package versions
command: ./release-scripts/update-dev-versions.sh
Expand Down Expand Up @@ -387,6 +397,7 @@ jobs:
- install_release_dependencies
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Updating package versions
command: |
Expand Down Expand Up @@ -446,7 +457,7 @@ workflows:
ignore:
- master
- test-windows:
name: Jest Tests (Windows, Node v14.17.5)
name: Jest Tests (Windows)
context: nodejs-install
requires:
- Build
Expand All @@ -465,7 +476,7 @@ workflows:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
node_version: ['10.24.1', '12.22.9', '14.18.2', '16.13.2']
- test-tap:
name: Tap Tests
context: nodejs-install
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/check-dependencies.yml
Expand Up @@ -9,19 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install -g npm@7

- name: npm config get cache
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npx npm@7 config get cache)"
- uses: actions/cache@v2
id: npm-cache
- uses: actions/setup-node@v2
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-
- run: npm install
node-version: '16.13.2'
cache: 'npm'
- run: npm ci
- run: npx ts-node ./scripts/check-dependencies.ts
8 changes: 4 additions & 4 deletions .github/workflows/cli-alert.yml
Expand Up @@ -12,11 +12,11 @@ jobs:
working-directory: ./packages/cli-alert
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm install -g npm@7
- run: npm install
node-version: '16.13.2'
cache: 'npm'
- run: npm ci
- run: npm start
env:
USER_GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/danger-zone.yml
Expand Up @@ -11,9 +11,8 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16.13.2'
cache: 'npm'
- run: npm install -g npm@7
- run: npm ci
- run: npx danger ci
env:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
14
16.13.2
2 changes: 1 addition & 1 deletion docker-desktop/build.sh
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

platform="${1}"
arch="${2}"
node_version="v16.13.1"
node_version="v16.13.2"
node_url="https://nodejs.org/dist/${node_version}/node-${node_version}-${platform}-${arch}.tar.gz"
build_name="snyk-for-docker-desktop-${platform}-${arch}"
build_filename="${build_name}.tar.gz"
Expand Down

0 comments on commit 9cd65c6

Please sign in to comment.