Skip to content

Commit

Permalink
fix(napi): update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickersoft committed Nov 18, 2024
1 parent f717247 commit 6870489
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ jobs:
whoami
env
freebsd-version
pnpm install
pnpm install --no-frozen-lockfile
pnpm --filter="@odict/node" build
rm -rf node_modules
rm -rf target
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-freebsd
path: ${{ env.APP_NAME }}.*.node
path: bindings/node/dist/${{ env.APP_NAME }}.*.node
if-no-files-found: error
test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: .
path: bindings/node/dist
- name: List packages
run: ls -R .
shell: bash
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-unknown-linux-gnu
path: .
path: bindings/node/dist
- name: List packages
run: ls -R .
shell: bash
Expand Down Expand Up @@ -288,7 +288,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-unknown-linux-musl
path: .
path: bindings/node/dist
- name: List packages
run: ls -R .
shell: bash
Expand All @@ -311,7 +311,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bindings-aarch64-unknown-linux-gnu
path: .
path: bindings/node/dist
- name: List packages
run: ls -R .
shell: bash
Expand Down Expand Up @@ -345,7 +345,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bindings-aarch64-unknown-linux-musl
path: .
path: bindings/node/dist
- name: List packages
run: ls -R .
shell: bash
Expand All @@ -366,7 +366,7 @@ jobs:
options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build"
run: |
set -e
pnpm --filter="@odict/node" test
pnpm --filter="@odict/node" test
test-linux-arm-gnueabihf-binding:
name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }}
needs:
Expand All @@ -384,7 +384,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: bindings-armv7-unknown-linux-gnueabihf
path: .
path: bindings/node/dist
- name: List packages
run: ls -R .
shell: bash
Expand Down Expand Up @@ -433,7 +433,7 @@ jobs:
name: bindings-aarch64-apple-darwin
path: artifacts
- name: Combine binaries
run: pnpm universal
run: pnpm --filter="@odict/node" universal
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -466,9 +466,9 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
path: bindings/node/artifacts
- name: Move artifacts
run: pnpm artifacts
run: pnpm --filter="@odict/node" artifacts
- name: List packages
run: ls -R ./npm
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion bindings/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"scripts": {
"build": "napi build --release --platform --pipe \"prettier -w\" ./dist",
"build:debug": "napi build --platform --pipe \"prettier -w\" ./dist",
"test": "pnpm run build && vitest --no-watch",
"test": "vitest --no-watch",
"universal": "napi universal",
"artifacts": "napi artifacts",
"version": "napi version",
Expand Down
1 change: 1 addition & 0 deletions bindings/node/tasks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ run = "pnpm --filter=\"@odict/node\" npm publish"

["test:node"]
run = "pnpm --filter=\"@odict/node\" test -- "
depends = ["build:node"]

["ci:node"]
run = "act napi --container-architecture linux/amd64 --bind --job build"
Expand Down
4 changes: 2 additions & 2 deletions bindings/node/tests/dictionary.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe("Dictionary", () => {

beforeAll(async () => {
dict1Path = join(
fileURLToPath(new URL(import.meta.url)),
fileURLToPath(new URL(import.meta.url), { windows: false }),
"../../../../examples/example1.xml"
);

dict1 = await Dictionary.compile(dict1Path);

dict2Path = join(
fileURLToPath(new URL(import.meta.url)),
fileURLToPath(new URL(import.meta.url), { windows: false }),
"../../../../examples/example2.xml"
);

Expand Down

0 comments on commit 6870489

Please sign in to comment.