mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-09-24 20:10:28 +01:00
Repo spring cleaning (#746)
- Add CI workflow (pytest + frontend typecheck/tests) on PRs - Add CodeQL static analysis for Python and JS/TS - Add Dependabot for pip, npm, Docker, and GitHub Actions - Tighten workflow permissions
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
backend-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
cache: "pip"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements-base.txt
|
||||
pip install -r requirements-shelfmark.txt
|
||||
pip install pytest
|
||||
|
||||
- name: Run tests
|
||||
run: pytest tests/ -x --tb=short
|
||||
|
||||
frontend-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
cache-dependency-path: src/frontend/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: src/frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Typecheck
|
||||
working-directory: src/frontend
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Unit tests
|
||||
working-directory: src/frontend
|
||||
run: npm run test:unit
|
||||
Reference in New Issue
Block a user