Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 15 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,33 @@ name: CI

on:
push:
branches: [main]
branches: [ main, master, develop ]
pull_request:
branches: [main]
workflow_dispatch:
branches: [ main, master, develop ]

jobs:
build:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for package.json
id: check
run: |
if [ -f package.json ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "No package.json yet — skipping build/test until the project is scaffolded."
fi

- name: Setup Node.js
if: steps.check.outputs.exists == 'true'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '20.x'
cache: 'npm'

- name: Verify package.json presence
run: |
if [ ! -f "package.json" ]; then
echo "Error: package.json not found!"
exit 1
fi

- name: Install dependencies
if: steps.check.outputs.exists == 'true'
run: npm ci

- name: Run tests
if: steps.check.outputs.exists == 'true'
- name: Run build / test suite
run: npm test --if-present

- name: Build
if: steps.check.outputs.exists == 'true'
run: npm run build --if-present

Loading
Loading