Skip to content

ci: add GitHub Actions workflow for multi-platform testing #333

ci: add GitHub Actions workflow for multi-platform testing

ci: add GitHub Actions workflow for multi-platform testing #333

Workflow file for this run

# CI workflow for node-webcodecs
# Runs linting, building, and testing on all supported platforms
#
# Platforms:
# - Linux x64 glibc (Rocky Linux 8 container)
# - Linux x64 musl (Alpine 3.20 container)
# - macOS ARM64 (macos-14 runner)
# - macOS x64 (macos-13 runner)
#
# Node.js versions: 20, 22 (matching engines field)
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install cpplint
run: pip install cpplint
- name: Install dependencies
run: npm install
- name: Lint C++
run: cpplint --quiet src/*.h src/*.cc
- name: Lint TypeScript
run: npm run lint:ts
- name: Lint types
run: npm run lint:types
- name: Lint markdown
run: npm run lint:md
build-linux-glibc:
name: Linux glibc (Node ${{ matrix.node }})
runs-on: ubuntu-24.04
container: rockylinux:8
strategy:
matrix:
node: [20, 22]
steps:
- name: Install system dependencies
run: |
# Enable EPEL and CRB (PowerTools) repositories
dnf install -y epel-release
dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled crb || true
# Install build tools and FFmpeg
dnf install -y gcc-c++ make python3 git pkgconfig
# Install FFmpeg development packages from EPEL
dnf install -y ffmpeg-free-devel || dnf install -y --enablerepo=epel ffmpeg-devel || echo "FFmpeg not in EPEL, using RPMFusion"
# If FFmpeg not available, try RPMFusion
if ! pkg-config --exists libavcodec; then
dnf install -y https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm || true
dnf install -y ffmpeg-devel || true
fi
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install --omit=optional
- name: Build
run: npm run build
- name: Test
run: npm test
build-linux-musl:
name: Linux musl (Node ${{ matrix.node }})
runs-on: ubuntu-24.04
container: alpine:3.20
strategy:
matrix:
node: [20, 22]
steps:
- name: Install system dependencies
run: apk add --no-cache ffmpeg-dev build-base python3 pkgconfig git nodejs npm
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm install --omit=optional
- name: Build
run: npm run build
- name: Test
run: npm test
build-macos-arm64:
name: macOS ARM64 (Node ${{ matrix.node }})
runs-on: macos-14
strategy:
matrix:
node: [20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install FFmpeg
run: brew install ffmpeg
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install --omit=optional
- name: Build
run: npm run build
- name: Test
run: npm test
build-macos-x64:
name: macOS x64 (Node ${{ matrix.node }})
runs-on: macos-13
strategy:
matrix:
node: [20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install FFmpeg
run: brew install ffmpeg
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install --omit=optional
- name: Build
run: npm run build
- name: Test
run: npm test