Repository navigation
110 lines (95 loc) · 3.19 KB
/
Copy pathnapi.yml
File metadata and controls
110 lines (95 loc) · 3.19 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: NAPI
# CI check: build napi addon on push/PR to master.
# Publishing is handled by publish.yml (triggered by v* tag).
on:
push:
branches: ['master']
paths:
- 'float-pigment-css-napi/**'
- 'float-pigment-css/**'
- '.github/workflows/napi.yml'
pull_request:
branches: ['master']
paths:
- 'float-pigment-css-napi/**'
- 'float-pigment-css/**'
- '.github/workflows/napi.yml'
defaults:
run:
working-directory: float-pigment-css-napi
env:
DEBUG: napi:*
APP_NAME: float-pigment-css-napi
MACOSX_DEPLOYMENT_TARGET: '10.13'
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: aarch64-apple-darwin
build: pnpm run build --target aarch64-apple-darwin
- host: macos-latest
target: x86_64-apple-darwin
build: pnpm run build --target x86_64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
build: pnpm run build --target x86_64-pc-windows-msvc
- host: windows-latest
target: i686-pc-windows-msvc
build: pnpm run build --target i686-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: pnpm run build --target x86_64-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
build: pnpm run build --target x86_64-unknown-linux-musl -x
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
build: pnpm run build --target aarch64-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
build: pnpm run build --target aarch64-unknown-linux-musl -x
name: build - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.92.0'
targets: ${{ matrix.settings.target }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: 'float-pigment-css-napi -> ../target'
- name: Setup zig
if: ${{ contains(matrix.settings.target, 'musl') }}
uses: mlugg/setup-zig@v2
with:
version: 0.14.1
- name: Install cargo-zigbuild
if: ${{ contains(matrix.settings.target, 'musl') }}
uses: taiki-e/install-action@v2
with:
tool: cargo-zigbuild
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: ${{ matrix.settings.build }}
shell: bash
- name: Test
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' || matrix.settings.target == 'x86_64-unknown-linux-gnu' || matrix.settings.target == 'x86_64-pc-windows-msvc' }}
run: pnpm test
shell: bash