Skip to content

Commit

Permalink
Merge pull request #1 from jumpstarter-dev/github-actions-makefile
Browse files Browse the repository at this point in the history
Add makefile and github action scripts
  • Loading branch information
mangelajo authored Jun 26, 2024
2 parents 0fdb883 + 461e3df commit dde2e4c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Generate stubs"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: read
jobs:
generate:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Running generate
run: make generate

- name: Verify that stubs are up-to-date
run: git diff --exit-code

20 changes: 20 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Code Quality"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: read
jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Running Linter
run: make lint
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BUF_IMAGE=docker.io/bufbuild/buf:latest
BUF=podman run --volume "$(shell pwd):/workspace" --workdir /workspace docker.io/bufbuild/buf:latest

GENERATED_GO=go/jumpstarter/v1/jumpstarter.pb.go go/jumpstarter/v1/jumpstarter_grpc.pb.go \
go/jumpstarter/v1/router.pb.go go/jumpstarter/v1/router_grpc.pb.go
GENERATED_PYTHON=python/jumpstarter/v1/jumpstarter_pb2.py python/jumpstarter/v1/jumpstarter_pb2_grpc.py \
python/jumpstarter/v1/router_pb2.py python/jumpstarter/v1/router_pb2_grpc.py

all: $(GENERATED_GO) $(GENERATED_PYTHON)

lint:
$(BUF) lint

go/jumpstarter/v1/jumpstarter.pb.go: proto/jumpstarter/v1/jumpstarter.proto
$(BUF) generate

go/jumpstarter/v1/jumpstarter_grpc.pb.go: proto/jumpstarter/v1/jumpstarter.proto
$(BUF) generate


go/jumpstarter/v1/router.pb.go: proto/jumpstarter/v1/router.proto
$(BUF) generate

go/jumpstarter/v1/router_grpc.pb.go: proto/jumpstarter/v1/router.proto
$(BUF) generate



.PHONY: lint generate

0 comments on commit dde2e4c

Please sign in to comment.