name: CI on: push: branches: [main, develop] pull_request: branches: [main, develop] workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: lint: name: Lint runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Checkout code uses: actions/checkout@v7 with: persist-credentials: false - name: Set up Python uses: actions/setup-python@v7 with: python-version: '3.12' cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install zizmor==1.31.1 actionlint-py==1.7.12.25 # TODO: remove after appinfra is released to PyPI # check: ruff, mypy and pylint, which the duplicated-code check runs python -m pip install "appinfra[check] @ git+https://github.com/llm-works/appinfra.git@develop" - name: Lint workflows # zizmor policy in .github/zizmor.yml; actionlint runs shellcheck on run: scripts run: | zizmor --offline .github/workflows/ actionlint - name: Check formatting run: python -m ruff format --check . - name: Lint run: python -m ruff check . - name: Check function size, duplicated and dead code run: | python -m appinfra.cli.cli -l error cq cf --strict python -m appinfra.cli.cli -l error cq dup docsite/ --strict python -m appinfra.cli.cli -l error cq dead docsite/ --strict - name: Type check run: python -m mypy docsite/ --ignore-missing-imports - name: Check SPDX headers run: appinfra cq spdx test: name: Test runs-on: ubuntu-latest needs: lint timeout-minutes: 10 steps: - name: Checkout code uses: actions/checkout@v7 with: persist-credentials: false - name: Set up Python uses: actions/setup-python@v7 with: python-version: '3.12' cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip # TODO: remove after appinfra is released to PyPI python -m pip install "appinfra[check] @ git+https://github.com/llm-works/appinfra.git@develop" python -m pip install -e ".[dev]" - name: Run unit and integration tests with coverage run: >- python -m pytest tests/ -m "unit or integration" -v --tb=short --cov=docsite --cov-fail-under=95 --cov-report=term