Skip to content

Commit

Permalink
Merge branch 'main' into bcrypt-wasm-bench
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU authored Feb 19, 2023
2 parents 1265fdd + 43a40ea commit 5fff96e
Show file tree
Hide file tree
Showing 121 changed files with 2,665 additions and 2,326 deletions.
12 changes: 6 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+sse4.2"]
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+sse4.2"]
[target.x86_64-apple-darwin]
rustflags = ["-C", "target-feature=+sse4.2"]
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ coverage
*.d.ts
target
packages/deno-lint/cli.js
packages/deno-lint/cli.d.ts
packages/deno-lint/cli.d.ts
3 changes: 2 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parser: '@typescript-eslint/parser'

parserOptions:
ecmaVersion: 2020
ecmaVersion: latest
sourceType: module

env:
Expand All @@ -25,6 +25,7 @@ rules:
'comma-dangle': ['error', 'only-multiline']
'no-unused-vars': 0
'no-var': 2
'no-empty': 0
'one-var-declaration-per-line': 2
'prefer-const': 2
'no-const-assign': 2
Expand Down
74 changes: 22 additions & 52 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ jobs:
- host: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
# Node.js in Baidu need to compatible with `GLIBC_2.12`
build: >-
set -e &&
rustup toolchain install $(cat ./rust-toolchain) &&
rustup target add x86_64-unknown-linux-gnu &&
yarn lerna exec "yarn build --target x86_64-unknown-linux-gnu" --concurrency 1 --stream --no-prefix &&
strip packages/*/*.node
Expand All @@ -59,17 +57,14 @@ jobs:
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
yarn lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
strip -x packages/*/*.node
- host: ubuntu-18.04
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
setup: |
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y
build: |
rustup toolchain install $(cat ./rust-toolchain)
rustup target add aarch64-unknown-linux-gnu
yarn lerna exec "yarn build --target aarch64-unknown-linux-gnu" --concurrency 1 --stream --no-prefix
aarch64-linux-gnu-strip packages/*/*.node
- host: ubuntu-18.04
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: >-
rustup target add aarch64-unknown-linux-gnu &&
yarn lerna exec "yarn build --target aarch64-unknown-linux-gnu" --concurrency 1 --stream --no-prefix &&
llvm-strip packages/*/*.node
- host: ubuntu-latest
target: 'armv7-unknown-linux-gnueabihf'
setup: |
sudo apt-get update
Expand All @@ -78,22 +73,12 @@ jobs:
- host: ubuntu-latest
target: aarch64-linux-android
build: |
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CC="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CXX="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
export AR="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
export PATH="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
yarn lerna exec "yarn build --target aarch64-linux-android" --concurrency 1 --stream --no-prefix
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/*/*.node
- host: ubuntu-latest
architecture: x64
target: armv7-linux-androideabi
build: |
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CC="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CXX="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++"
export PATH="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
export AR="${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
yarn lerna exec "yarn build --target armv7-linux-androideabi" --concurrency 1 --stream --no-prefix
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip packages/*/*.node
- host: ubuntu-latest
Expand All @@ -102,14 +87,13 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: >-
set -e &&
rustup toolchain install $(cat ./rust-toolchain) &&
rustup target add aarch64-unknown-linux-musl &&
yarn lerna exec "yarn build --target aarch64-unknown-linux-musl" --concurrency 1 --stream --no-prefix
- host: windows-latest
target: 'aarch64-pc-windows-msvc'
build: yarn lerna exec "yarn build --target aarch64-pc-windows-msvc" --concurrency 1 --stream --no-prefix

name: stable - ${{ matrix.settings.target }} - node@16
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}

steps:
Expand All @@ -119,23 +103,16 @@ jobs:
uses: actions/setup-node@v3
if: ${{ !matrix.settings.docker }}
with:
node-version: 16
node-version: 18
check-latest: true
cache: yarn

- name: Install
uses: actions-rs/toolchain@v1
if: ${{ !matrix.settings.docker }}
with:
profile: minimal
override: true
target: ${{ matrix.settings.target }}

- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
command: generate-lockfile
toolchain: nightly-2023-01-11
targets: ${{ matrix.settings.target }}

- name: Cache cargo registry
uses: actions/cache@v3
Expand All @@ -147,17 +124,16 @@ jobs:
.cargo-cache
key: ${{ matrix.settings.target }}-cargo-registry

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-build-${{ matrix.settings.target }}-node@16

- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash

- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
with:
version: 0.10.0

- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
Expand All @@ -181,7 +157,7 @@ jobs:
uses: actions/setup-node@v3
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 16
node-version: 18
check-latest: true
cache: yarn
architecture: x86
Expand All @@ -205,7 +181,7 @@ jobs:
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0.2.3
uses: vmactions/freebsd-vm@v0
env:
DEBUG: 'napi:*'
RUSTUP_HOME: /usr/local/rustup
Expand All @@ -216,9 +192,9 @@ jobs:
usesh: true
mem: 3000
prepare: |
pkg install -y curl python2 node14
pkg install -y -f curl node libnghttp2
curl -qL https://www.npmjs.com/install.sh | sh
npm install -g yarn
npm install --location=global --ignore-scripts yarn
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
export PATH="/usr/local/cargo/bin:$PATH"
Expand Down Expand Up @@ -592,16 +568,10 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
check-latest: true
cache: yarn

- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: node_modules
key: npm-cache-ubuntu-latest-publish-${{ hashFiles('yarn.lock') }}

- name: 'Install dependencies'
run: yarn install --immutable --mode=skip-build

Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,21 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Install
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
override: true
toolchain: nightly-2023-01-11
components: rustfmt, clippy

- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: npm-cache-lint-node@16-${{ hashFiles('yarn.lock') }}

- name: 'Install dependencies'
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org
run: yarn install --mode=skip-build

- name: ESLint
run: yarn lint
Expand Down
Loading

0 comments on commit 5fff96e

Please sign in to comment.