CI #380
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] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: '15 22 * * *' | |
| workflow_dispatch: {} # support manual runs | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| name: "Tests and Benchmarks" | |
| strategy: | |
| matrix: | |
| # We use macos here because those are the only ARM runners available | |
| # to private repositories. | |
| os: [ubuntu-latest, macos-15] | |
| mode: [fast, debug, race, unopt] | |
| go-version: [1.24.x, 1.25.x] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v5 | |
| with: {fetch-depth: 1} | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: {go-version: "${{ matrix.go-version }}"} | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: "${{ runner.os }}-hyperpb-ci-${{ hashFiles('**/go.sum') }}" | |
| restore-keys: "${{ runner.os }}-hyperpb-ci-" | |
| - name: Check Generated Files | |
| if: ${{ matrix.mode == 'fast' }} | |
| run: | | |
| make generate | |
| make checkgenerate | |
| - name: Test | |
| if: ${{ matrix.mode == 'fast' }} | |
| run: make test | |
| - name: Test Debug | |
| if: ${{ matrix.mode == 'debug' }} | |
| run: make test TAGS=debug | |
| - name: Test Race | |
| if: ${{ matrix.mode == 'race' }} | |
| run: make test HYPERTESTFLAGS=-race | |
| # TODO(#30): Remove one this is fixed. | |
| - name: Test Unoptimized | |
| if: ${{ matrix.mode == 'unopt' }} | |
| run: make test HYPERTESTFLAGS=-unopt | |
| - name: Benchmark | |
| if: ${{ matrix.mode == 'fast' }} | |
| run: make bench BENCHMARK="B/^descriptor.yaml" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: [1.24.x, 1.25.x] | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v5 | |
| with: {fetch-depth: 1} | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: {go-version: "${{ matrix.go-version }}"} | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: {version: v2.4.0} # Keep in sync with the Makefile. |