Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use buf-action in CI #115

Merged
merged 5 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/buf-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: buf
Copy link
Contributor Author

@emcfarlane emcfarlane Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File renamed for improved support for IDEs as buf.yaml will validate the file as a buf configuration file rather than a GitHub actions workflow file.

on:
push:
branches:
- main
emcfarlane marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
contents: read
pull-requests: write
env:
BUF_VERSION: 1.32.2
emcfarlane marked this conversation as resolved.
Show resolved Hide resolved
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-action@v0.1
with:
token: ${{ secrets.BUF_TOKEN }}
45 changes: 0 additions & 45 deletions .github/workflows/buf.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: ci
on: push
permissions: read-all
env:
BUF_VERSION: 1.32.2
jobs:
ci:
runs-on: ubuntu-latest
Expand All @@ -12,12 +14,13 @@ jobs:
- name: install
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false
nicksnyder marked this conversation as resolved.
Show resolved Hide resolved
- name: cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-registry-proto-ci-${{ hashFiles('**/Makefile') }}
key: ${{ runner.os }}-registry-proto-ci-${{ hashFiles('Makefile') }}
restore-keys: ${{ runner.os }}-registry-proto-ci-
- name: make
run: make
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BIN := .tmp/bin
export PATH := $(BIN):$(PATH)
export GOBIN := $(abspath $(BIN))

BUF_VERSION := v1.32.0-beta.1
BUF_VERSION ?= 1.32.2
COPYRIGHT_YEARS := 2023-2024

.PHONY: help
Expand Down Expand Up @@ -56,8 +56,8 @@ checkgenerate:

$(BIN)/buf: Makefile
@mkdir -p $(@D)
go install github.com/bufbuild/buf/cmd/buf@$(BUF_VERSION)
go install github.com/bufbuild/buf/cmd/buf@v$(BUF_VERSION)

$(BIN)/license-header: Makefile
@mkdir -p $(@D)
go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@$(BUF_VERSION)
go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v$(BUF_VERSION)