Add tracer labeling page #33
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: Server PRs | |
| on: | |
| pull_request: | |
| paths: | |
| - 'server/**' | |
| jobs: | |
| type-check: | |
| runs-on: ubuntu-latest | |
| env: | |
| working-directory: ${{ github.workspace }}/server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| virtualenvs-path: ${{ env.working-directory }}/.venv | |
| installer-parallel: true | |
| - name: Load cached venv | |
| id: cached-poetry-dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.working-directory }}/.venv | |
| key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock')}} | |
| - name: Install dependencies | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| run: poetry install --no-interaction --no-root | |
| working-directory: ${{ env.working-directory }} | |
| - name: Install project | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true' | |
| run: poetry install --no-interaction | |
| working-directory: ${{ env.working-directory }} | |
| - name: Type checking | |
| run: | | |
| source .venv/bin/activate | |
| mypy --strict ttfd/ | |
| working-directory: ${{ env.working-directory }} | |
| tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| working-directory: ${{ github.workspace }}/server | |
| CLIENT_ID: "" | |
| CLIENT_SECRET: "" | |
| DATABASE_URI: "sqlite:///test.db" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| virtualenvs-path: ${{ env.working-directory }}/.venv | |
| installer-parallel: true | |
| - name: Load cached venv | |
| id: cached-poetry-dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.working-directory }}/.venv | |
| key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock')}} | |
| - name: Install dependencies | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| run: poetry install --no-interaction --no-root | |
| working-directory: ${{ env.working-directory }} | |
| - name: Install project | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true' | |
| run: poetry install --no-interaction | |
| working-directory: ${{ env.working-directory }} | |
| - name: Run tests | |
| run: | | |
| source .venv/bin/activate | |
| coverage run -m pytest -rxXs --approvaltests-use-reporter='PythonNativeReporter' | |
| coverage report | |
| working-directory: ${{ env.working-directory }} | |
| lint-format: | |
| runs-on: ubuntu-latest | |
| env: | |
| working-directory: ${{ github.workspace }}/server | |
| permissions: | |
| security-events: write | |
| actions: read | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| virtualenvs-path: ${{ env.working-directory }}/.venv | |
| installer-parallel: true | |
| - name: Load cached venv | |
| id: cached-poetry-dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.working-directory }}/.venv | |
| key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock')}} | |
| - name: Install dependencies | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| run: poetry install --no-interaction --no-root | |
| working-directory: ${{ env.working-directory }} | |
| - name: Install project | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true' | |
| run: poetry install --no-interaction | |
| working-directory: ${{ env.working-directory }} | |
| - name: Check formatting | |
| run: | | |
| source .venv/bin/activate | |
| ruff format --check ttfd/ | |
| working-directory: ${{ env.working-directory }} | |
| - name: Linting | |
| run: | | |
| source .venv/bin/activate | |
| ruff check ttfd/ | |
| working-directory: ${{ env.working-directory }} | |
| - name: Security linting | |
| run: | | |
| source .venv/bin/activate | |
| bandit -c pyproject.toml -r ttfd | |
| working-directory: ${{ env.working-directory }} |