Add multiple configurable REST resources (TypeScript template) #111
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: Python Copier API Build | |
| on: | |
| push: | |
| paths: | |
| - python/** | |
| - .github/workflows/build-python-pipeline.yaml | |
| - .github/actions/setup-copier-template/** | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - python/** | |
| - .github/workflows/build-python-pipeline.yaml | |
| - .github/actions/setup-copier-template/** | |
| branches: | |
| - main | |
| jobs: | |
| build-python: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| template-type: | |
| - python | |
| cloud-service: | |
| - "Azure Function App" | |
| - "GCP Cloud Function" | |
| - "AWS Lambda" | |
| python-version: | |
| - "3.13" | |
| - "3.14" | |
| fail-fast: false | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| - name: Setup Copier Template | |
| uses: ./.github/actions/setup-copier-template | |
| with: | |
| template-language: ${{ matrix.template-type }} | |
| template-cloud-service: ${{ matrix.cloud-service }} | |
| - name: Set up python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Poetry | |
| env: | |
| POETRY_VERSION: "1.8.3" | |
| run: curl -sSL https://install.python-poetry.org | python - -y | |
| shell: bash | |
| - name: Add Poetry to Path (Linux and macOS) | |
| if: runner.os != 'Windows' | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| shell: bash | |
| - name: Add Poetry to Path (Windows) | |
| if: runner.os == 'Windows' | |
| run: echo "$HOME\\AppData\\Roaming\\Python\\Scripts" >> $GITHUB_PATH | |
| shell: bash | |
| - name: Configure Poetry virtual environment in project | |
| run: poetry config virtualenvs.in-project true | |
| shell: bash | |
| - name: Load cached venv | |
| id: cached-poetry-dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.cloud-service }}-${{ hashFiles('**/pyproject.toml') }} | |
| - name: Install dependencies | |
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| run: | | |
| cd "KittenClaws" | |
| poetry install --no-interaction | |
| shell: bash | |
| - name: Run lint | |
| run: | | |
| cd "KittenClaws" | |
| poetry run ruff check . | |
| shell: bash | |
| - name: Run unit tests | |
| run: | | |
| cd "KittenClaws" | |
| poetry run pytest --cov | |
| shell: bash | |
| - name: Run dependency vulnerability scan | |
| continue-on-error: true | |
| run: | | |
| cd "KittenClaws" | |
| poetry run pip install pip-audit | |
| set +e | |
| poetry run pip-audit 2>&1 | tee audit.log | |
| status=$? | |
| set -e | |
| { | |
| echo "### Python dependency vulnerability scan (${{ matrix.cloud-service }})" | |
| echo "" | |
| echo '```' | |
| cat audit.log | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| exit $status | |
| shell: bash |