Skip to content

Commit

Permalink
feat: add node binding (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Oct 12, 2023
1 parent 2401386 commit 9391f16
Show file tree
Hide file tree
Showing 72 changed files with 12,374 additions and 36 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/bench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Benchmark
on:
issue_comment:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
Expand All @@ -16,10 +16,10 @@ jobs:
steps:
- name: Checkout Branch
uses: actions/checkout@v4
- name: Install Rust

- name: Install Rust
uses: ./.github/actions/rustup

- name: Prepare Benchmark
run: |
git clone https://github.com/mrdoob/three.js.git --depth 1 ./temp/three.js
Expand All @@ -38,7 +38,7 @@ jobs:
ref: main

- name: Run Bench on Main Branch
run: cargo bench -p bench -- --save-baseline baseline
run: cargo bench -p bench -- --save-baseline baseline

- name: Compare Bench Results
id: bench_comparison
Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Run Clippy
run: cargo clippy --all -- --deny warnings

test:
test:
name: Test
runs-on: ubuntu-latest
steps:
Expand All @@ -61,4 +61,42 @@ jobs:
uses: taiki-e/install-action@cargo-nextest

- name: Run Test
run: cargo nextest run
run: cargo nextest run

node-test:
name: Node test
runs-on: 'ubuntu-latest'
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macos-latest

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: ./.github/actions/rustup

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: 'Install dependencies'
run: yarn install

- name: Format
run: yarn prettier

- name: Build
run: |
yarn build
- name: Test
run: |
yarn test
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
packages/**/dist/*
crates
target
temp
.yarn

**/.git
**/node_modules

30 changes: 15 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
12 changes: 3 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@
},
"files.associations": {
"*.snap": "markdown",
"*.snap.new": "markdown",
},
"cSpell.words": [
"Finalizer",
"importee",
"rolldown",
"rollup",
"rustc"
],
"*.snap.new": "markdown"
},
"cSpell.words": ["Finalizer", "importee", "rolldown", "rollup", "rustc"]
}
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.4.1.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'

yarnPath: .yarn/releases/yarn-3.4.1.cjs
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Setup Project

## Install Rust
Expand All @@ -10,7 +9,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

## Install binstall


```bash
# https://github.com/cargo-bins/cargo-binstall
cargo install cargo-binstall
Expand All @@ -32,4 +30,4 @@ just test # Run project test
just lint # Run lint
just fmt # Run format
just bench-prepare && just bench # Run benchmarks
```
```

0 comments on commit 9391f16

Please sign in to comment.