name: Go

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ '*' ]

permissions:
  contents: read

jobs:

  build:
    name: API Diff Check
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.x
      uses: actions/setup-go@v2
      with:
        go-version: "1.24"
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2

    - name: Get dependencies
      run: |
        (cd /tmp && go install golang.org/x/exp/cmd/gorelease@latest)

    - name: Check APIs
      run: $(go env GOPATH)/bin/gorelease
