Repository navigation
ci: verification matrix, release pipeline, and BCR templates #1
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: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup OCX | |
| uses: ocx-sh/ocx/.github/actions/setup-ocx@main | |
| with: | |
| version: "0.3.10" | |
| - name: Lint (buildifier, actionlint, license headers, links) | |
| run: ocx run -- task lint | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup OCX | |
| uses: ocx-sh/ocx/.github/actions/setup-ocx@main | |
| with: | |
| version: "0.3.10" | |
| - name: Unit tests, smoke tests, docs freshness | |
| run: ocx run -- bazelisk test //... --verbose_test_summary | |
| examples: | |
| name: Example ${{ matrix.example }} (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| example: [project, package, cross_platform] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup OCX | |
| uses: ocx-sh/ocx/.github/actions/setup-ocx@main | |
| with: | |
| version: "0.3.10" | |
| - name: Test example (live ocx.sh registry — dogfooding) | |
| working-directory: examples/${{ matrix.example }} | |
| run: ocx --project ../../ocx.toml run -- bazelisk test //... --verbose_test_summary | |
| offline: | |
| name: Offline determinism | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup OCX | |
| uses: ocx-sh/ocx/.github/actions/setup-ocx@main | |
| with: | |
| version: "0.3.10" | |
| - name: Warm fetch | |
| run: ocx run -- bazelisk fetch @dev_tools//... | |
| - name: Refetch offline against the warmed store (must succeed) | |
| run: OCX_OFFLINE=1 ocx run -- bazelisk fetch --force @dev_tools//... | |
| - name: Refetch offline against an empty store (must fail) | |
| run: | | |
| if OCX_HOME="$RUNNER_TEMP/empty-ocx-home" OCX_OFFLINE=1 \ | |
| ocx run -- bazelisk fetch --force @dev_tools//...; then | |
| echo "expected the offline fetch against an empty store to fail" >&2 | |
| exit 1 | |
| fi | |
| echo "offline failure mode OK" |