Skip to content

chore: add templates, CODEOWNERS, and CI workflow #1

chore: add templates, CODEOWNERS, and CI workflow

chore: add templates, CODEOWNERS, and CI workflow #1

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 11, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('package.json') != '', (Line: 29, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('requirements.txt') != '' || hashFiles('pyproject.toml') != ''
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
node:
if: ${{ hashFiles('package.json') != '' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install
run: npm ci
- name: Lint (if present)
run: npm run -s lint --if-present
- name: Test (if present)
run: npm run -s test --if-present
python:
if: ${{ hashFiles('requirements.txt') != '' || hashFiles('pyproject.toml') != '' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install deps (if requirements.txt)
run: |
if [ -f requirements.txt ]; then
python -m pip install --upgrade pip
pip install -r requirements.txt
fi
- name: Run pytest if tests are present
run: |
if ls -1 tests test_*.py 2>/dev/null | grep -q .; then
pip install pytest
pytest -q
else
echo "No python tests found; skipping"
fi