[app-channel 5] snapshot-agent: document the app-channel backend in the user guide #377
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: CI - PR Checks | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| # Detect if PR contains code changes (skip expensive checks for docs-only PRs) | |
| check-code-changes: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| has_code_changes: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v7 | |
| - name: Check for code changes | |
| uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - '!docs/**' | |
| - '!**/*.md' | |
| - '!LICENSE' | |
| - '!OWNERS' | |
| # Go: lint, build, and test | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| needs: check-code-changes | |
| if: needs.check-code-changes.outputs.has_code_changes == 'true' | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v7 | |
| - name: Extract Go version from go.mod | |
| run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: "${{ env.GO_VERSION }}" | |
| cache-dependency-path: ./go.sum | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.8.0 | |
| args: "" | |
| - name: Build | |
| run: make build | |
| - name: Test | |
| run: make test | |
| # Python: lint and test (only if Python files exist) | |
| python-lint-and-test: | |
| runs-on: ubuntu-latest | |
| needs: check-code-changes | |
| if: needs.check-code-changes.outputs.has_code_changes == 'true' | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v7 | |
| - name: Check for Python files | |
| id: check-python | |
| run: | | |
| if find . -name "*.py" -not -path "./.git/*" | head -1 | grep -q .; then | |
| echo "has_python=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "has_python=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Set up Python | |
| if: steps.check-python.outputs.has_python == 'true' | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| if: steps.check-python.outputs.has_python == 'true' | |
| run: pip install ./pkg/client/python | |
| - name: Install ruff | |
| if: steps.check-python.outputs.has_python == 'true' | |
| # Pinned so lint results only change when we bump the version, not | |
| # when ruff releases (0.16.0 introduced 101 new findings, see #116). | |
| run: pip install ruff==0.15.22 | |
| - name: Run ruff check | |
| if: steps.check-python.outputs.has_python == 'true' | |
| run: ruff check . | |
| - name: Run ruff format check | |
| if: steps.check-python.outputs.has_python == 'true' | |
| run: ruff format --check . | |
| - name: Run unit tests | |
| if: steps.check-python.outputs.has_python == 'true' | |
| run: PYTHONPATH=pkg/client/python python -m unittest discover -s pkg/client/python/tests | |
| # Container: build (no push) to validate Dockerfile | |
| container-build: | |
| runs-on: ubuntu-latest | |
| needs: check-code-changes | |
| if: needs.check-code-changes.outputs.has_code_changes == 'true' | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build container (no push) | |
| run: | | |
| docker buildx build \ | |
| --platform linux/amd64 \ | |
| --tag test-build:pr-${{ github.event.pull_request.number }} \ | |
| . |