Repository navigation
fix(kb): never commit .sageox/.gitignore into Knowledge Bubbles #1993
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| # Cancel superseded runs on PR branches, but NEVER on main: a push to main is | |
| # validating a merge, and cancelling it would leave the branch unverified. | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Configure git identity for tests | |
| run: | | |
| git config --global user.email "ci@sageox.ai" | |
| git config --global user.name "CI" | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Check generated CLI docs | |
| run: make docs-check | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v1.13.0 | |
| # Agent-friendly test output: | |
| # --format pkgname-and-test-fails only prints package names + failing tests | |
| # --hide-summary skipped collapses the skipped-test summary | |
| # --format-hide-empty-pkg hides packages with no test files | |
| # --junitfile structured artifact for digest + post-mortem | |
| # Verbose mode (humans/local debugging): OX_TEST_LOG=1 + run gotestsum without | |
| # these flags, or call `make test` with V=1. | |
| - name: Fast tests | |
| if: github.event_name == 'push' | |
| run: | | |
| TEST_JUNIT=test-results.xml \ | |
| TEST_TIMINGS=test-timings.json \ | |
| make test | |
| - name: Test harness contracts | |
| run: make coverage-ratchet-test | |
| - name: Full tests (PR gate) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| TEST_JUNIT=test-results.xml \ | |
| TEST_TIMINGS=test-timings.json \ | |
| make test-all | |
| - name: Require requested test artifacts | |
| run: | | |
| test -s test-results.xml | |
| test -s test-timings.json | |
| python3 -c 'import xml.etree.ElementTree as ET; root = ET.parse("test-results.xml").getroot(); assert any(root.iter("testcase")), "JUnit artifact has no test cases"' | |
| python3 scripts/test_metrics.py test-timings.json >/dev/null | |
| - name: Compiled-binary acceptance (PR gate) | |
| if: github.event_name == 'pull_request' | |
| run: make test-acceptance | |
| - name: Digital twins (PR gate) | |
| if: github.event_name == 'pull_request' | |
| run: make test-digital-twin | |
| - name: Failure digest | |
| if: always() && hashFiles('test-results.xml') != '' | |
| run: | | |
| python3 .github/scripts/junit_to_summary.py test-results.xml >> "$GITHUB_STEP_SUMMARY" | |
| if test -f test-timings.json; then | |
| python3 scripts/test_metrics.py --markdown test-timings.json >> "$GITHUB_STEP_SUMMARY" || echo "Test timing metrics unavailable." >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: Upload JUnit results | |
| if: always() && hashFiles('test-results.xml') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: test-results.xml | |
| retention-days: 14 | |
| - name: Upload test timing events | |
| if: always() && hashFiles('test-timings.json') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-timing-events | |
| path: test-timings.json | |
| retention-days: 14 | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.11.4 | |
| args: -c .config/golangci.yml | |
| # The skill installer is the one subsystem where Windows is a first-class | |
| # target rather than an aspiration: copy materialization IS what Windows gets, | |
| # because the symlink helper elsewhere in ox silently no-ops there. The | |
| # installer has ZERO GOOS branches today and is portable precisely because it | |
| # relies only on Lstat and rename — this job is what keeps that true, since a | |
| # regression would give Windows users no skills and no error. | |
| skills-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # This job runs no authenticated git operations, and a persisted | |
| # GITHUB_TOKEN in the local git config is readable by every later step. | |
| persist-credentials: false | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Configure git identity for tests | |
| run: | | |
| git config --global user.email "ci@sageox.ai" | |
| git config --global user.name "CI" | |
| - name: Skill inventory tests | |
| run: go test ./internal/skillmanager/... ./internal/sageoxignore/... ./extensions/skills/... -count=1 |