-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (60 loc) · 2.02 KB
/
test.yml
File metadata and controls
74 lines (60 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test
on:
workflow_call:
jobs:
test:
runs-on: ${{ matrix.os }}
name: Test Node - ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
# Disable Windows Test as it's running indefinitely
# - os: windows-latest
# target: x86_64-pc-windows-msvc
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get NAPI info
id: napi-info
uses: rstackjs/rspack-toolchain/get-napi-info@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
- name: Download rspack binding
uses: rstackjs/rspack-toolchain/download-rspack-binding@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
with:
target: ${{ matrix.target }}
path: ${{ steps.napi-info.outputs.binding-directory }}
- name: Show binding
shell: bash
run: |
echo "Contents of binding directory:"
ls -la ${{ steps.napi-info.outputs.binding-directory }}
echo ""
echo "*.node files:"
find ${{ steps.napi-info.outputs.binding-directory }} -name "*.node" -type f -exec ls -la {} \; || echo "No .node files found"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Enable corepack
run: corepack enable
- name: Setup pnpm
run: corepack prepare
- name: Cache pnpm dependencies
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
- name: Run example - plugin
run: node build.js
working-directory: examples/use-plugin
- name: Run example - loader
run: node build.js
working-directory: examples/use-loader