Skip to content

Mark 0.1.0 as published (#4) #10

Mark 0.1.0 as published (#4)

Mark 0.1.0 as published (#4) #10

Workflow file for this run

---
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type-check
run: npm run type-check
- name: Build
run: npm run build
- name: Unit tests
run: npm test
# Gated integration leg: runs the real-upstream suite only when the
# TINYFISH_API_KEY secret exists. GitHub does not allow `secrets.*` in a
# job-level `if:`, so the documented pattern is used instead — export the
# secret into the job env and branch on it inside a step. Fork PRs never
# receive secrets (the job-level `if:` also skips them outright), and the
# test suite itself skips with a notice when the key is empty, so this job
# is green-but-inert until the secret is configured.
integration:
runs-on: ubuntu-latest
needs: ci
if: github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
env:
TINYFISH_API_KEY: ${{ secrets.TINYFISH_API_KEY }}
steps:
- name: Detect API key secret
id: key
run: |
if [ -n "$TINYFISH_API_KEY" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "TINYFISH_API_KEY secret not configured - skipping integration tests"
fi
- name: Checkout code
if: steps.key.outputs.present == 'true'
uses: actions/checkout@v4
- name: Setup Node.js
if: steps.key.outputs.present == 'true'
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
if: steps.key.outputs.present == 'true'
run: npm ci
- name: Integration tests (real hosted upstream)
if: steps.key.outputs.present == 'true'
run: npm run test:integration