Skip to content

fix: update CI workflow to handle missing secrets gracefully, add con… #44

fix: update CI workflow to handle missing secrets gracefully, add con…

fix: update CI workflow to handle missing secrets gracefully, add con… #44

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
name: Test on ${{ matrix.os }} Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install system build deps (macOS)
if: runner.os == 'macOS'
run: |
brew update || true
brew install pkg-config python cmake || true
- name: Install system build deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 pkg-config cmake || true
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test -- --coverage
env:
SNIP_GIST_TOKEN: ${{ secrets.SNIP_GIST_TOKEN || '' }}
- name: Run sql.js smoke
run: npm run smoke-sqljs
- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == '20.x'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN || '' }}
files: ./coverage/coverage-final.json
flags: unittests
fail_ci_if_error: false
verbose: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run lint
build:
name: Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- name: Build package
run: npm run prepublishOnly