check for outdated protofiles #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.3 | |
- name: Set up protoc | |
run: | | |
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.21.12/protoc-3.21.12-linux-x86_64.zip | |
unzip protoc-3.21.12-linux-x86_64.zip -d protoc3 | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
sudo mv protoc3/include/* /usr/local/include/ | |
sudo chmod +x /usr/local/bin/protoc | |
protoc --version | |
- name: Install protoc-gen-go | |
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 | |
- name: Generated protofiles are upto date | |
run: | | |
make generate-golang | |
git diff --exit-code | |
changed_files=$(git diff --name-only) | |
if [ -n "$changed_files" ]; then | |
echo "The following protobuf files are not updated:" | |
echo "$changed_files" | |
exit 1 | |
fi | |
- name: No formatting changes | |
run: | | |
make format | |
changed_files=$(git diff --name-only) | |
if [ -n "$changed_files" ]; then | |
echo "The following files are not formatted:" | |
echo "$changed_files" | |
exit 1 | |
fi | |
- name: Test | |
run: make test | |
- name: Integration Test | |
run: make integration |