-
-
Notifications
You must be signed in to change notification settings - Fork 6
123 lines (116 loc) · 3.62 KB
/
y-octo-node.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Y-Octo Node Binding Build & Test
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
env:
DEBUG: napi:*
COVERAGE: true
MACOSX_DEPLOYMENT_TARGET: "10.13"
jobs:
build-node:
name: Build Node Binding
strategy:
fail-fast: false
matrix:
settings:
# - target: x86_64-apple-darwin
# host: macos-latest
- target: aarch64-apple-darwin
host: macos-latest
- target: x86_64-pc-windows-msvc
host: windows-latest
# - target: aarch64-pc-windows-msvc
# host: windows-latest
- target: x86_64-unknown-linux-gnu
host: ubuntu-latest
# - target: aarch64-unknown-linux-gnu
# host: ubuntu-latest
# - target: x86_64-unknown-linux-musl
# host: ubuntu-latest
# - target: aarch64-unknown-linux-musl
# host: ubuntu-latest
runs-on: ${{ matrix.settings.host }}
env:
RUSTFLAGS: "-C debuginfo=1"
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: ${{ matrix.settings.target }}
- name: Build node binding
run: yarn build:node --target ${{ matrix.settings.target }}
- name: Upload y-octo.node
uses: actions/upload-artifact@v3
with:
name: y-octo.${{ matrix.settings.target }}.node
path: ./y-octo-node/*.node
if-no-files-found: error
test-node:
name: Test & Collect Coverage
runs-on: ubuntu-latest
continue-on-error: true
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
components: llvm-tools-preview
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
run: cargo llvm-cov nextest --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v3
with:
name: tests
files: lcov.info
node-binding-test:
name: Node Binding Test
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-apple-darwin
host: macos-latest
- target: x86_64-unknown-linux-gnu
host: ubuntu-latest
- target: x86_64-pc-windows-msvc
host: windows-latest
runs-on: ${{ matrix.settings.host }}
needs: build-node
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Download y-octo.${{ matrix.settings.target }}.node
uses: actions/download-artifact@v3
with:
name: y-octo.${{ matrix.settings.target }}.node
path: ./y-octo-node
- name: Run node binding tests
run: ls -lah & ls -lah tests
working-directory: y-octo-node
shell: bash
- name: Run node binding tests
run: yarn test:node:coverage
working-directory: y-octo-node
shell: bash
- name: Upload server test coverage results
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./y-octo-node/.coverage/lcov.info
flags: node-binding-test
name: y-octo.${{ matrix.settings.target }}.node
fail_ci_if_error: false