Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More testing, bug fixes, better CI #1

Merged
merged 11 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 57 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI and Publish
on:
push:
branches:
- '**'
- "**"
tags:
- 'v*.*.*'
- "v*.*.*"

jobs:
build:
Expand All @@ -16,40 +16,68 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 22
registry-url: 'https://registry.npmjs.org/'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 22
registry-url: "https://registry.npmjs.org/"

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Run tests
run: npm test
- name: Run tests
run: npm test

integrationtest:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 22
registry-url: "https://registry.npmjs.org/"

- name: Try to npm install
run: |
mkdir npm-install-test
cd npm-install-test
npm init -y
npm install ../ --save --install-links --foreground-scripts

- name: Run integration test
run: |
cd npm-install-test
cp node_modules/node-bzip2/test/integration.js integration.js
node integration.js

publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

needs: build
needs: [build, integrationtest]

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true

- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
19 changes: 15 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"action_name": "configure_bzip2",
"inputs": [],
"outputs": ["<(INTERMEDIATE_DIR)/bzip2"],
"outputs": ["<(INTERMEDIATE_DIR)/bzip2/bz_version.h"],
"action": [
"cmake",
"-S",
Expand All @@ -23,14 +23,25 @@
},
{
"action_name": "build_bzip2",
"inputs": ["<(INTERMEDIATE_DIR)/bzip2"],
"outputs": ["<(INTERMEDIATE_DIR)/bzip2/bz_version.h"],
"inputs": ["<(INTERMEDIATE_DIR)/bzip2/bz_version.h"],
"outputs": [],
"action": [
"cmake",
"--build",
"<(INTERMEDIATE_DIR)/bzip2",
"--config=Release",
],
"conditions": [
[
'OS=="win"',
{
"outputs": [
"<(INTERMEDIATE_DIR)/bzip2/Release/bz2_static.lib"
]
},
{"outputs": ["<(INTERMEDIATE_DIR)/bzip2/libbz2_static.a"]},
]
],
},
],
"sources": ["src/node_bzip2_wrapper.cpp"],
Expand All @@ -44,11 +55,11 @@
"AdditionalOptions": ["/MD"],
}
},
"xcode_settings": {"GCC_ENABLE_CPP_EXCEPTIONS": "YES"},
"conditions": [
[
'OS=="mac"',
{
"xcode_settings": {"GCC_ENABLE_CPP_EXCEPTIONS": "YES"},
"cflags": ["-mmacosx-version-min=11.0"],
},
],
Expand Down
Loading
Loading