Pitch kscli as agent long-term memory + fix runtime crash in agent_help #39
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: Test | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Cache virtual environment | |
| uses: actions/cache@v4 | |
| id: cache-venv | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| venv-${{ runner.os }}- | |
| - name: Install dev dependencies | |
| run: uv sync --all-extras --group dev | |
| - name: Run ruff check | |
| run: make lint | |
| - name: Run type checker | |
| run: make typecheck | |
| e2e: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') | |
| steps: | |
| - name: Generate GitHub App token | |
| uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.RELEASE_GH_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ks-backend | |
| - name: Checkout ks-cli | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ks-cli | |
| - name: Checkout ks-backend | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: knowledgestack/ks-backend | |
| token: ${{ steps.app-token.outputs.token }} | |
| path: ks-backend | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| ks-backend/uv.lock | |
| ks-cli/uv.lock | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Install ks-backend dependencies | |
| working-directory: ks-backend | |
| run: make install-dev | |
| - name: Create shared email directory | |
| run: mkdir -p /tmp/ks/e2e-testing/emails && chmod 777 /tmp/ks/e2e-testing/emails | |
| - name: Start e2e stack | |
| working-directory: ks-backend | |
| run: make e2e-stack | |
| - name: Seed database | |
| working-directory: ks-backend | |
| run: make e2e-prep | |
| - name: Install ks-cli dependencies | |
| working-directory: ks-cli | |
| run: uv sync --all-extras --group dev | |
| - name: Run e2e tests | |
| working-directory: ks-cli | |
| run: make e2e-test | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: "production" | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| needs: [lint, e2e] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Generate release token | |
| uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.RELEASE_GH_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_GH_APP_PRIVATE_KEY }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| token: ${{ steps.app-token.outputs.token }} | |
| persist-credentials: true | |
| fetch-depth: 0 | |
| - name: Setup | Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Install dev dependencies | |
| run: uv sync | |
| - name: Get current version | |
| id: current-version | |
| run: | | |
| REPO_VERSION=$(uv version --short) | |
| echo "Detected current version=${REPO_VERSION}" | |
| echo "prevtag=v${REPO_VERSION}" >> $GITHUB_OUTPUT | |
| # Don't use the official python-semantic-release action because it's too slow | |
| - name: Run semantic-release | |
| id: semantic-release | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} # For release publishing | |
| run: | | |
| uvx python-semantic-release -c semantic_release.toml version --vcs-release --changelog | |
| NEW_TAG=$(uvx python-semantic-release -c semantic_release.toml version --print-tag) | |
| echo "Current semantic release tag=${NEW_TAG}" | |
| echo "tag=$NEW_TAG" >> $GITHUB_OUTPUT | |
| - name: Check for build artifacts | |
| id: check-dist | |
| run: | | |
| if ls dist/*.whl dist/*.tar.gz 1>/dev/null 2>&1; then | |
| echo "has_dist=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_dist=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Publish to PyPI | |
| if: steps.check-dist.outputs.has_dist == 'true' | |
| uses: pypa/gh-action-pypi-publish@release/v1 |