Skip to content
Latchkey

proto-checks workflow (thrasher-corp/gocryptotrader)

The proto-checks workflow from thrasher-corp/gocryptotrader, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: thrasher-corp/gocryptotrader.github/workflows/proto-lint.ymlLicense MITView source

What it does

This is the proto-checks workflow from the thrasher-corp/gocryptotrader repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: proto-checks
'on':
  - push
  - pull_request
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
  proto-lint:
    name: proto-checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Setup Go
        uses: actions/setup-go@v6
        with:
          go-version: 1.26.x

      - name: Setup build depends
        run: |
          go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
          go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
          go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
          go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

      - uses: bufbuild/buf-setup-action@v1.50.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

      - name: buf generate
        working-directory: ./gctrpc
        run: buf generate

      - uses: bufbuild/buf-lint-action@v1
        with:
          input: gctrpc
          
      - name: buf format
        run: buf format --diff --exit-code

      - name: buf generate backtester
        working-directory: ./backtester/btrpc
        run: buf generate

      - uses: bufbuild/buf-lint-action@v1
        with:
          input: ./backtester/btrpc

      - name: buf format backtester
        run: buf format --diff --exit-code

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: proto-checks
'on':
  - push
  - pull_request
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  proto-lint:
    timeout-minutes: 30
    name: proto-checks
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v7
 
      - name: Setup Go
        uses: actions/setup-go@v6
        with:
          go-version: 1.26.x
 
      - name: Setup build depends
        run: |
          go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
          go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
          go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
          go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
 
      - uses: bufbuild/buf-setup-action@v1.50.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
 
      - name: buf generate
        working-directory: ./gctrpc
        run: buf generate
 
      - uses: bufbuild/buf-lint-action@v1
        with:
          input: gctrpc
          
      - name: buf format
        run: buf format --diff --exit-code
 
      - name: buf generate backtester
        working-directory: ./backtester/btrpc
        run: buf generate
 
      - uses: bufbuild/buf-lint-action@v1
        with:
          input: ./backtester/btrpc
 
      - name: buf format backtester
        run: buf format --diff --exit-code
 

What changed

2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow