Skip to content

Nodejs binding

Nodejs binding #30

Workflow file for this run

name: C
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'demo/c/**'
- '!demo/c/README.md'
- 'project/**'
- '!project/README.md'
- '.github/workflows/c.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'demo/c/**'
- '!demo/c/README.md'
- 'project/**'
- '!project/README.md'
- '.github/workflows/c.yml'
jobs:
build-github-hosted:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
pv_speaker_platform: linux
output_dir: linux/x86_64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="${{ matrix.pv_speaker_platform }}" -DOUTPUT_DIR="${{ matrix.output_dir }}"
working-directory: project
- name: Build
run: cmake --build ./build
working-directory: project
- name: Test
run: ctest --output-on-failure
working-directory: project/build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pv_speaker_platform }}
path: |
lib/${{ matrix.output_dir }}/libpv_speaker.*
lib/node/${{ matrix.output_dir }}/pv_speaker.node
retention-days: 3
build-self-hosted:
runs-on: ${{ matrix.machine }}
strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-32, rpi5-64]
include:
- machine: rpi3-32
pv_speaker_platform: raspberry-pi3
output_dir: raspberry-pi/cortex-a53
- machine: rpi3-64
pv_speaker_platform: raspberry-pi3-64
output_dir: raspberry-pi/cortex-a53-aarch64
- machine: rpi4-32
pv_speaker_platform: raspberry-pi4
output_dir: raspberry-pi/cortex-a72
- machine: rpi4-64
pv_speaker_platform: raspberry-pi4-64
output_dir: raspberry-pi/cortex-a72-aarch64
- machine: rpi5-32
pv_speaker_platform: raspberry-pi5
output_dir: raspberry-pi/cortex-a76
- machine: rpi5-64
pv_speaker_platform: raspberry-pi5-64
output_dir: raspberry-pi/cortex-a76-aarch64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="${{ matrix.pv_speaker_platform }}" -DOUTPUT_DIR="${{ matrix.output_dir }}"
working-directory: project
- name: Build
run: cmake --build ./build
working-directory: project
- name: Test
run: ctest --output-on-failure
working-directory: project/build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pv_speaker_platform }}
path: |
lib/${{ matrix.output_dir }}/libpv_speaker.*
lib/node/${{ matrix.output_dir }}/pv_speaker.node
retention-days: 3
build-mac:
runs-on: pv-ios
strategy:
matrix:
pv_speaker_platform: [mac-arm64, mac-x86_64]
include:
- pv_speaker_platform: mac-arm64
output_dir: mac/arm64
- pv_speaker_platform: mac-x86_64
output_dir: mac/x86_64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="${{ matrix.pv_speaker_platform }}" -DOUTPUT_DIR="${{ matrix.output_dir }}"
working-directory: project
- name: Build
run: cmake --build ./build
working-directory: project
- name: Test
run: ctest --output-on-failure
working-directory: project/build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pv_speaker_platform }}
path: |
lib/${{ matrix.output_dir }}/libpv_speaker.*
lib/node/${{ matrix.output_dir }}/pv_speaker.node
retention-days: 3
build-windows:
runs-on: pv-windows
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: cmake -B ./build -S . -DPV_SPEAKER_PLATFORM="windows" -DOUTPUT_DIR="windows/amd64"
working-directory: project
shell: pwsh
- name: Build
run: cmake --build ./build
working-directory: project
shell: pwsh
- name: Test
run: ctest --output-on-failure
working-directory: project/build
shell: pwsh
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: windows
path: |
lib/windows/amd64/libpv_speaker.*
lib/node/windows/amd64/pv_speaker.node
retention-days: 3
collect-artifacts:
runs-on: ubuntu-latest
needs: [build-github-hosted, build-self-hosted, build-mac, build-windows]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Make collection directory
run: mkdir -p all-libs/lib
- name: Collect artifacts
shell: bash
run: |
for DIR in artifacts/*; do cp -a $DIR/* all-libs/lib/; done
- name: Upload all artifacts
uses: actions/upload-artifact@v3
with:
name: all-libs
path: all-libs
retention-days: 3