fix(agent-tasks): guard args slice when 'tasks' called with no subcommand #1100
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [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: Install gotestsum | |
| run: go install gotest.tools/gotestsum@latest | |
| # 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 | |
| # --rerun-fails=1 on failure, re-runs only the failed test with -v | |
| # --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: | | |
| gotestsum \ | |
| --format pkgname-and-test-fails \ | |
| --hide-summary skipped \ | |
| --format-hide-empty-pkg \ | |
| --rerun-fails=1 \ | |
| --packages=./... \ | |
| --junitfile test-results.xml \ | |
| -- -short -race -p 8 -parallel 32 -timeout=10m | |
| - name: Full tests (PR gate) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| gotestsum \ | |
| --format pkgname-and-test-fails \ | |
| --hide-summary skipped \ | |
| --format-hide-empty-pkg \ | |
| --rerun-fails=1 \ | |
| --packages=./... \ | |
| --junitfile test-results.xml \ | |
| -- -race -p 8 -parallel 32 -timeout=15m | |
| - name: Failure digest | |
| if: always() && hashFiles('test-results.xml') != '' | |
| run: python3 .github/scripts/junit_to_summary.py test-results.xml >> "$GITHUB_STEP_SUMMARY" | |
| - 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 | |
| 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@v7 | |
| with: | |
| version: v2.11.4 | |
| args: -c .config/golangci.yml |