ci #21
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: CI (GitHub) | |
on: | |
- push | |
- pull_request | |
permissions: {} | |
jobs: | |
CI: | |
permissions: | |
contents: write # for npx prebuild to make release | |
name: ${{ matrix.container || matrix.os }} - Node.js ${{ matrix.nodejs_version }} ${{ matrix.nodejs_arch }} ${{ matrix.prebuild && '- prebuild' }} | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
container: rockylinux:8 | |
nodejs_arch: x64 | |
nodejs_version: "^18.17.0" | |
nodejs_version_major: 18 | |
platform: linux-x64 | |
prebuild: true | |
- os: ubuntu-22.04 | |
container: rockylinux:8 | |
nodejs_arch: x64 | |
nodejs_version: "^20.3.0" | |
nodejs_version_major: 20 | |
platform: linux-x64 | |
- os: ubuntu-22.04 | |
container: node:18-alpine3.17 | |
nodejs_version_major: 18 | |
platform: linuxmusl-x64 | |
prebuild: true | |
- os: ubuntu-22.04 | |
container: node:20-alpine3.18 | |
nodejs_version_major: 20 | |
platform: linuxmusl-x64 | |
- os: macos-12 | |
nodejs_arch: x64 | |
nodejs_version: "^18.17.0" | |
nodejs_version_major: 18 | |
platform: darwin-x64 | |
prebuild: true | |
- os: macos-12 | |
nodejs_arch: x64 | |
nodejs_version: "^20.3.0" | |
nodejs_version_major: 20 | |
platform: darwin-x64 | |
- os: macos-14 | |
nodejs_arch: arm64 | |
nodejs_version: "^18.17.0" | |
nodejs_version_major: 18 | |
platform: darwin-arm64 | |
prebuild: true | |
- os: macos-14 | |
nodejs_arch: arm64 | |
nodejs_version: "^20.3.0" | |
nodejs_version_major: 20 | |
platform: darwin-arm64 | |
- os: windows-2019 | |
nodejs_arch: x86 | |
nodejs_version: "18.18.2" # pinned to avoid 18.19.0 and npm 10 | |
nodejs_version_major: 18 | |
platform: win32-ia32 | |
prebuild: true | |
- os: windows-2019 | |
nodejs_arch: x86 | |
nodejs_version: "^20.3.0" | |
nodejs_version_major: 20 | |
platform: win32-ia32 | |
- os: windows-2019 | |
nodejs_arch: x64 | |
nodejs_version: "^18.17.0" | |
nodejs_version_major: 18 | |
platform: win32-x64 | |
prebuild: true | |
- os: windows-2019 | |
nodejs_arch: x64 | |
nodejs_version: "^20.3.0" | |
nodejs_version_major: 20 | |
platform: win32-x64 | |
steps: | |
- name: Dependencies (Rocky Linux glibc) | |
if: contains(matrix.container, 'rockylinux') | |
run: | | |
dnf install -y gcc-toolset-11-gcc-c++ make git python3.12 fontconfig google-noto-sans-fonts | |
echo "/opt/rh/gcc-toolset-11/root/usr/bin" >> $GITHUB_PATH | |
- name: Dependencies (Python 3.11 - macOS, Windows) | |
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows') | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Dependencies (Node.js) | |
if: "!contains(matrix.platform, 'linuxmusl')" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.nodejs_version }} | |
architecture: ${{ matrix.nodejs_arch }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install | |
run: npm install --build-from-source | |
- name: Test | |
run: npm test | |
- name: Prebuild | |
if: matrix.prebuild && startsWith(github.ref, 'refs/tags/') | |
env: | |
prebuild_upload: ${{ secrets.GITHUB_TOKEN }} | |
run: npx prebuild --runtime napi --target 7 |