chore: add tests #27
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "**" | |
| jobs: | |
| commits: | |
| name: Commit Messages (Conventional Commits) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (full history) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install commitlint | |
| run: npm ci --ignore-scripts | |
| - name: Lint commits (PR) | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.sha }} --verbose | |
| - name: Lint commits (push) | |
| if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' && github.event.before != '0000000000000000000000000000000000000000' }} | |
| run: npx commitlint --from ${{ github.event.before }} --to ${{ github.sha }} --verbose | |
| ui: | |
| name: UI Typecheck + Test + Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: apps/ui/package-lock.json | |
| - name: Install UI deps | |
| working-directory: apps/ui | |
| run: npm ci | |
| - name: Typecheck | |
| working-directory: apps/ui | |
| run: npm run typecheck | |
| - name: Lint UI | |
| working-directory: apps/ui | |
| run: npm run lint | |
| - name: Test UI | |
| working-directory: apps/ui | |
| run: npx vitest run | |
| - name: Build UI | |
| working-directory: apps/ui | |
| run: npm run build | |
| python: | |
| name: Python Tests + Compile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install API/Worker requirements | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r apps/api/requirements.txt | |
| python -m pip install -r apps/worker/requirements.txt | |
| python -m pip install "pytest>=8.0.0" | |
| - name: Run Python tests | |
| run: python -m pytest -q | |
| - name: Compile Python sources | |
| run: python -m compileall apps/api/src apps/worker/src | |
| docker: | |
| name: Docker Build Verification | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build API image | |
| run: docker build -t clevis-api -f apps/api/Dockerfile . | |
| - name: Build Worker image | |
| run: docker build -t clevis-worker -f apps/worker/Dockerfile apps/worker | |
| - name: Build UI image | |
| run: docker build -t clevis-ui -f apps/ui/Dockerfile apps/ui | |