feat: continue node binding #168
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: x86_64-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 |