Skip to content

Commit

Permalink
Merge pull request #222 from Mister-Hope/master
Browse files Browse the repository at this point in the history
feat!: refine package
  • Loading branch information
yanyiwu committed Jun 2, 2023
2 parents 17f15f0 + 7ff438c commit f104646
Show file tree
Hide file tree
Showing 30 changed files with 3,409 additions and 2,853 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/node.js.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- v*.**

jobs:
build:
name: Build binary for ${{ matrix.os }} and Node.js ${{ matrix.node-version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [16, 18, 20]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: |
args: [--ignore-scripts]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Build binary
run: pnpm binary:build

- name: Pack binary
run: pnpm binary:pack

- name: Release
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }}
run: pnpm binary:release
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
name: Test on ${{ matrix.os }} and Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [16, 18, 20]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: |
args: [--ignore-scripts]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Build binary
run: pnpm binary:build

- name: BenchMark
run: pnpm test:benchmark

- name: Coverage
run: pnpm test:coverage

- name: Upload coverage
if: github.ref == 'refs/heads/master'
uses: codecov/codecov-action@v3
24 changes: 5 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
tags
build
*.demo
*swp
*.out
*.o
*.d
*.ut
log
main
lib*.a
*_demo
segdict*
tmp
t.*
*.pid
node_modules
npm-debug.log
.idea
.idea/
node_modules/
build/
coverage/
dist/
90 changes: 0 additions & 90 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"configurations": [
{
"name": "Linux",
"includePath": ["${workspaceFolder}/**"],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
Loading

0 comments on commit f104646

Please sign in to comment.