opencode-config/.github/workflows/ci.yml
opencode-agent a08385c9dd
All checks were successful
CI / bootstrap (push) Successful in 22s
CI / complexity (push) Successful in 41s
CI / lint (push) Successful in 41s
CI / typecheck (push) Successful in 41s
CI / test (3.13) (push) Successful in 1m43s
ci: use preinstalled tools from custom runner image (drop setup-uv/python/node actions)
2026-08-06 16:30:34 +00:00

80 lines
2.1 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
paths-ignore: ['**/*.md', 'docs/**', 'LICENSE']
push:
branches: [main]
paths-ignore: ['**/*.md', 'docs/**', 'LICENSE']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
bootstrap:
runs-on: ubuntu-latest
outputs:
has_src: ${{ steps.check.outputs.has_src }}
steps:
- uses: actions/checkout@v4
- id: check
run: |
if [ -n "$(find src/ -name '*.py' -print -quit 2>/dev/null)" ]; then
echo "has_src=true" >> $GITHUB_OUTPUT
else
echo "has_src=false" >> $GITHUB_OUTPUT
fi
- run: echo "CI bootstrap OK"
lint:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- run: uv sync --extra dev
- run: uv run ruff check src/ tests/ .opencode/scripts/
- run: uv run ruff format --check src/ tests/ .opencode/scripts/
typecheck:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- run: uv sync --extra dev
- run: uv run mypy src/
test:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: ["3.13"]
steps:
- uses: actions/checkout@v4
- run: npm ci
working-directory: .opencode
- run: npm ci
working-directory: .opencode/draw-image
- run: npm test
working-directory: .opencode/draw-image
- run: uv sync --extra dev --python ${{ matrix.python }}
- run: uv run --python ${{ matrix.python }} pytest
complexity:
needs: bootstrap
if: needs.bootstrap.outputs.has_src == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- run: uv sync --extra dev
- run: uv run xenon --max-absolute B --max-modules A --max-average A src/