Merge pull request #282 from operatorstack/fix/yield-go-scaffold #37
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: Verify Yield lab | |
| on: | |
| pull_request: | |
| paths: ["labs/22-yield/**", "go.work", ".github/workflows/yield-lab.yml"] | |
| push: | |
| branches: [main] | |
| paths: ["labs/22-yield/**", "go.work", ".github/workflows/yield-lab.yml"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: ./.github/actions/go-setup | |
| with: | |
| go-version-file: labs/22-yield/yield/go.mod | |
| cache-dependency-path: labs/22-yield/yield/go.sum | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: Rerun first-party evaluations and verify the published result | |
| working-directory: labs/22-yield/yield/evals | |
| run: | | |
| npm ci | |
| npm test | |
| - name: Build and smoke-test the packed TypeScript SDK | |
| working-directory: labs/22-yield/yield/sdk/typescript | |
| run: | | |
| npm test | |
| npm run build | |
| tarball="$RUNNER_TEMP/$(npm pack --silent --pack-destination "$RUNNER_TEMP")" | |
| smoke_dir="$(mktemp -d)" | |
| cd "$smoke_dir" | |
| npm init -y >/dev/null | |
| npm install "$tarball" >/dev/null | |
| node --input-type=module -e 'import { defineSkill } from "@operatorstack/yield"; if (typeof defineSkill !== "function") process.exit(1)' | |
| - name: Verify package launchers and release metadata | |
| working-directory: labs/22-yield/yield | |
| run: | | |
| node --test packaging/*.test.mjs | |
| python -m unittest discover -s sdk/python -p 'test_*.py' | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| labs/22-yield/yield/sdk/rust | |
| labs/22-yield/yield/examples/data-migration | |
| labs/22-yield/yield/examples/library/rust | |
| labs/22-yield/yield/internal/conformance/testdata/skill-rs | |
| - name: Vet and test (includes subprocess e2e + 4-language conformance) | |
| working-directory: labs/22-yield/yield | |
| run: | | |
| go vet ./... | |
| go test ./... | |
| - name: Fixture runs of the example skills (Go, TypeScript, Python, Rust) | |
| working-directory: labs/22-yield/yield | |
| run: | | |
| go build -o /tmp/yskill ./cmd/yskill | |
| /tmp/yskill test examples/investigate | |
| /tmp/yskill test examples/release-checklist | |
| /tmp/yskill test examples/env-doctor | |
| /tmp/yskill test examples/data-migration | |
| YSKILL=/tmp/yskill /tmp/yskill test examples/convert-skill | |
| YSKILL=/tmp/yskill bash ./examples/library/test-all.sh | |
| # Shift-left projection gate: materialize the public surface exactly as | |
| # operatorstack/yield would receive it and compile+test it, so a broken | |
| # projection fails at PR time instead of downstream after merge. | |
| projection-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Project yield to a temp public tree | |
| run: | | |
| mkdir -p "$RUNNER_TEMP/yield-projected" | |
| uv run --project labkit python -m labkit project \ | |
| --config labs/22-yield/publish.config.json \ | |
| --repo "$RUNNER_TEMP/yield-projected" \ | |
| --source-commit "${{ github.sha }}" --write | |
| - uses: ./.github/actions/go-setup | |
| with: | |
| go-version-file: ${{ runner.temp }}/yield-projected/go.mod | |
| cache-dependency-path: ${{ runner.temp }}/yield-projected/go.sum | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: Rerun projected first-party evaluations | |
| working-directory: ${{ runner.temp }}/yield-projected/evals | |
| run: | | |
| npm ci | |
| npm test | |
| - name: Build and smoke-test the projected TypeScript package | |
| working-directory: ${{ runner.temp }}/yield-projected/sdk/typescript | |
| run: | | |
| tarball="$RUNNER_TEMP/$(npm pack --silent --pack-destination "$RUNNER_TEMP")" | |
| smoke_dir="$(mktemp -d)" | |
| cd "$smoke_dir" | |
| npm init -y >/dev/null | |
| npm install "$tarball" >/dev/null | |
| node --input-type=module -e 'import { defineSkill } from "@operatorstack/yield"; if (typeof defineSkill !== "function") process.exit(1)' | |
| - name: Verify projected package launchers and release metadata | |
| working-directory: ${{ runner.temp }}/yield-projected | |
| run: | | |
| node --test packaging/*.test.mjs | |
| python -m unittest discover -s sdk/python -p 'test_*.py' | |
| - name: Build and test the projected module (incl. 4-language conformance) | |
| working-directory: ${{ runner.temp }}/yield-projected | |
| env: | |
| GOWORK: "off" | |
| run: | | |
| go build ./... | |
| go test ./... |