Repository navigation
58 lines (54 loc) · 2.03 KB
/
Copy pathwindows-napi.yml
File metadata and controls
58 lines (54 loc) · 2.03 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
name: windows-napi
# Builds and tests the addon on pull requests. Releases publish it from npm_release.yml.
on:
pull_request:
paths:
- 'windows-napi/**'
- 'runtime/**'
- 'metadata/**'
- '.github/workflows/windows-napi.yml'
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
settings:
- target: x86_64-pc-windows-msvc
- target: aarch64-pc-windows-msvc
name: build ${{ matrix.settings.target }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 20
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
targets: ${{ matrix.settings.target }}
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: ${{ matrix.settings.target }}
- name: Install npm dependencies
working-directory: windows-napi
run: npm ci
- name: Build .node
working-directory: windows-napi
run: npx napi build --platform --release --target ${{ matrix.settings.target }}
- name: Run test suite (x64 only — the runner cannot execute arm64 binaries)
if: matrix.settings.target == 'x86_64-pc-windows-msvc'
working-directory: windows-napi
# Server runner SKUs can lack optional feature packs some suites touch (e.g. Media
# Foundation for the MediaPlayer event test), so failures here warn instead of block;
# the authoritative run is the local one on a client SKU.
continue-on-error: true
run: npm test
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: bindings-${{ matrix.settings.target }}
path: windows-napi/windows.*.node
if-no-files-found: error