Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
killagu committed Feb 1, 2025
1 parent b7738b1 commit b8e246f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 24 deletions.
74 changes: 52 additions & 22 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: npm run build -- --target x86_64-apple-darwin
build: npm run build:debug -- --target x86_64-apple-darwin
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: npm run build -- --target x86_64-unknown-linux-gnu
build: npm run build:debug -- --target x86_64-unknown-linux-gnu
- host: macos-latest
target: aarch64-apple-darwin
build: npm run build -- --target aarch64-apple-darwin
build: npm run build:debug -- --target aarch64-apple-darwin
name: stable - ${{ matrix.settings.target }} - node@20
runs-on: ${{ matrix.settings.host }}
steps:
Expand Down Expand Up @@ -69,6 +69,38 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
universal-macOS:
name: Build universal macOS binary
needs:
- build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm install
- name: Download macOS x64 artifact
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-apple-darwin
path: artifacts
- name: Download macOS arm64 artifact
uses: actions/download-artifact@v4
with:
name: bindings-aarch64-apple-darwin
path: artifacts
- name: Combine binaries
run: npm run universal
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-universal-apple-darwin
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
needs:
Expand Down Expand Up @@ -99,38 +131,36 @@ jobs:
shell: bash
- name: Test bindings
run: npm run test
universal-macOS:
name: Build universal macOS binary
test-universal-macos-binding:
name: Test bindings on macos - node@${{ matrix.node }}
needs:
- build
- universal-macOS
strategy:
fail-fast: false
matrix:
node:
- '20'
- '22'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: npm install
- name: Download macOS x64 artifact
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-apple-darwin
path: artifacts
- name: Download macOS arm64 artifact
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: bindings-aarch64-apple-darwin
path: artifacts
- name: Combine binaries
run: npm run universal
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-universal-apple-darwin
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
path: .
- name: List packages
run: ls -R .
shell: bash
- name: Test bindings
run: npm run test
publish:
name: Publish
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ pub fn cause_sigsegv() {

#[napi]
pub fn register() -> () {
segfault_handler::segfault_handler();
segfault_handler::register_segfault_handler();
}
2 changes: 1 addition & 1 deletion src/segfault_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn print_v8_backtrace() {
}
}

pub fn segfault_handler() {
pub fn register_segfault_handler() {
let sig_handler = SigHandler::SigAction(segfault_action);
let flags = SaFlags::SA_SIGINFO | SaFlags::SA_RESETHAND;
let sig_action = SigAction::new(sig_handler, flags, SigSet::empty());
Expand Down
1 change: 1 addition & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import coffee from 'coffee';
describe('test/index.test.ts', () => {
it('should print stack to stdout', async () => {
const res = await coffee.fork(path.join(__dirname, 'fixtures/test.js'))
.debug()
// FIXME coffee exit code is null
// .expect('code', 139)
.end();
Expand Down

0 comments on commit b8e246f

Please sign in to comment.