Skip to content

chore: Refactor to bundling prebuilds with prebuildify #424

chore: Refactor to bundling prebuilds with prebuildify

chore: Refactor to bundling prebuilds with prebuildify #424

Workflow file for this run

name: native-metrics CI
on:
pull_request:
push:
branches:
- '**'
tags-ignore: # Do not run for tags
- '**'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [lts/*]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
- name: Run Linting
run: npm run lint
- name: Inspect Lockfile
run: npm run lint:lockfile
test_x86_x64:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, windows-2019 ]
node: [ 16, 18, 20 ]
arch: [ x86, x64 ]
exclude:
# Ubuntu does not ship x86 builds.
- { os: ubuntu-latest, arch: x86 }
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Node ${{ matrix.node }} ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.arch }}
- name: Install
run: npm install
- name: Unit Test
run: npm run unit
- name: Post Unit Test Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/unit/
files: lcov.info
flags: unit-tests-${{ matrix.node }}-${{ matrix.os }}-${{ matrix.arch }}
- name: Integration Test
run: npm run integration
- name: Post Integration Test Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/integration/
files: lcov.info
flags: integration-tests-${{ matrix.node }}-${{ matrix.os }}-${{ matrix.arch }}
test_macos_arm:
strategy:
matrix:
os: [ macos-14 ]
node: [ 16, 18, 20 ]
arch: [ arm64 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Node ${{ matrix.node }} ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.arch }}
- name: Install
run: npm install
- name: Unit Test
run: npm run unit
- name: Post Unit Test Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/unit/
files: lcov.info
flags: unit-tests-${{ matrix.node }}-${{ matrix.os }}-${{ matrix-arch }}

Check failure on line 100 in .github/workflows/ci-workflow.yml

View workflow run for this annotation

GitHub Actions / native-metrics CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci-workflow.yml (Line: 100, Col: 18): Unrecognized named-value: 'matrix-arch'. Located at position 1 within expression: matrix-arch
- name: Integration Test
run: npm run integration
- name: Post Integration Test Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/integration/
files: lcov.info
flags: integration-tests-${{ matrix.node }}-${{ matrix.os }}-${{ matrix.arch }}
test_linux_arm:
strategy:
matrix:
node: [ 16, 18, 20 ]
runs-on: ubuntu-latest
name: Linux / Node ${{ matrix.node }} arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
context: .
build-args: |
NODE_VERSION=${{ matrix.node }}
file: linux_arm.dockerfile
tags: linux_arm:latest
load: true
push: false
platforms: linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run test
uses: addnab/docker-run-action@v3
with:
image: linux_arm:latest
options: --platform linux/arm64
run: |
npm install
npm run unit
npm run integration