Skip to content

Commit

Permalink
chore: rm bsd platform
Browse files Browse the repository at this point in the history
  • Loading branch information
PuffMeow committed Dec 12, 2023
1 parent a0612bf commit 41ce8df
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 226 deletions.
91 changes: 21 additions & 70 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: CI
env:
DEBUG: napi:*
APP_NAME: rusty-schema2ts
MACOSX_DEPLOYMENT_TARGET: '10.13'
MACOSX_DEPLOYMENT_TARGET: "10.13"
permissions:
contents: write
id-token: write
'on':
"on":
push:
branches:
- main
tags-ignore:
- '**'
- "**"
paths-ignore:
- '**/*.md'
- "**/*.md"
- LICENSE
- '**/*.gitignore'
- "**/*.gitignore"
- .editorconfig
- docs/**
pull_request: null
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
if: ${{ matrix.settings.docker }}
with:
image: ${{ matrix.settings.docker }}
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build"
run: ${{ matrix.settings.build }}
- name: Build
run: ${{ matrix.settings.build }}
Expand All @@ -155,54 +155,6 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
build-freebsd:
runs-on: macos-12
name: Build FreeBSD
steps:
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1
with:
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS
usesh: true
mem: 3000
prepare: |
pkg install -y -f curl node libnghttp2 npm yarn
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain beta
export PATH="/usr/local/cargo/bin:$PATH"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ yarn --version ~~~~"
yarn --version
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd
ls -lah
whoami
env
freebsd-version
yarn install
yarn build
strip -x *.node
yarn test
rm -rf node_modules
rm -rf target
rm -rf .yarn/cache
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: bindings-freebsd
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
needs:
Expand All @@ -211,9 +163,9 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
- "14"
- "16"
- "18"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -243,9 +195,9 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
- "14"
- "16"
- "18"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -277,9 +229,9 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
- "14"
- "16"
- "18"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -305,7 +257,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: node:${{ matrix.node }}-slim
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build"
run: |
set -e
yarn test
Expand Down Expand Up @@ -339,7 +291,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: node:lts-alpine
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build'
options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build"
run: |
set -e
yarn test
Expand All @@ -351,9 +303,9 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
- "14"
- "16"
- "18"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -378,7 +330,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: node:${{ matrix.node }}-bullseye-slim
options: '--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build'
options: "--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build"
run: |
set -e
yarn test
Expand Down Expand Up @@ -420,7 +372,6 @@ jobs:
name: Publish
runs-on: ubuntu-latest
needs:
- build-freebsd
- test-linux-x64-gnu-binding
- test-linux-x64-musl-binding
- test-linux-aarch64-gnu-binding
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ This tool can help you transform your JSON Schema to TypeScript interface very q

It's written by Rust(napi-rs) and only support in Node.js.

If you want the same feature that can work in Browser or all other platforms, you can see [schema2ts](https://github.com/PuffMeow/schema2ts).

Git repository: [rusty-schema2ts](https://github.com/PuffMeow/rusty-schema2ts). If you like it, please give me a little star⭐.

**The api of them are all the same**.

## TypeScript vs Rust
## Benchmark

You can find [benchmark here](https://github.com/PuffMeow/rusty-schema2ts/blob/main/bench/index.js)

Expand Down
Loading

0 comments on commit 41ce8df

Please sign in to comment.