Merge pull request #20 from xprilion/dev #41
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| lint-backend: | |
| name: Backend Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync | |
| working-directory: backend | |
| - name: Run ruff | |
| run: uv run ruff check openmlr/ tests/ | |
| working-directory: backend | |
| lint-frontend: | |
| name: Frontend Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| working-directory: frontend | |
| - name: Run ESLint | |
| run: pnpm lint | |
| working-directory: frontend | |
| test-backend: | |
| name: Backend Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-backend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync | |
| working-directory: backend | |
| - name: Run backend tests | |
| run: uv run pytest tests/ -v --tb=short | |
| working-directory: backend | |
| test-frontend: | |
| name: Frontend Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| working-directory: frontend | |
| - name: Type check | |
| run: npx tsc --noEmit | |
| working-directory: frontend | |
| - name: Run frontend tests | |
| run: pnpm test | |
| working-directory: frontend | |
| - name: Build | |
| run: pnpm build | |
| working-directory: frontend | |
| test-docs: | |
| name: Docs Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: site | |
| - name: Build docs | |
| run: npx vitepress build docs | |
| working-directory: site |