You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/.github/workflows/make-gen-delta.yml

68 lines
2.3 KiB

name: "make-gen-delta"
on:
- workflow_dispatch
- push
- workflow_call
permissions:
contents: read
jobs:
make-gen-delta:
name: "Check for uncommitted changes from make gen"
runs-on: ${{ fromJSON(vars.RUNNER) }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: '0'
- name: Determine Go version
id: get-go-version
# We use .go-version as our source of truth for current Go
# version, because "goenv" can react to it automatically.
run: |
echo "Building with Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: "${{ steps.get-go-version.outputs.go-version }}"
cache: false
- name: Determine Go cache paths
id: go-cache-paths
run: |
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
echo "go-bin=$(go env GOPATH)/bin" >> "$GITHUB_OUTPUT"
- name: Set up Go modules cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
${{ steps.go-cache-paths.outputs.go-mod }}
key: go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-mod
- name: Set up Go tools cache
id: go-tools-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
${{ steps.go-cache-paths.outputs.go-bin }}
key: go-tools-${{ steps.get-go-version.outputs.go-version }}-${{ hashFiles('**/go.sum', './Makefile', './tools/tools.go') }}
restore-keys: |
go-tools-${{ steps.get-go-version.outputs.go-version }}
- name: Running go mod tidy
run: |
go mod tidy
- name: Install Dependencies
if: steps.go-tools-cache.outputs.cache-hit != 'true'
run: |
go mod download
make tools
- name: Running make gen
run: |
make gen
- name: Check for changes
run: |
git diff --exit-code
git status --porcelain
test -z "$(git status --porcelain)"