Skip to content

Commit

Permalink
ci: check that proto files are in sync with generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
onsails committed Nov 17, 2023
1 parent 6cbd053 commit eb5e36b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Protobuf
# This workflow is only run when a .proto file has been changed
on:
pull_request:
paths:
- "proto/**"
# paths:
# - "proto/**"

jobs:
build:
Expand Down Expand Up @@ -33,13 +33,12 @@ jobs:
with:
input: "proto"

# FIXME: enable after merging
# break-check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: bufbuild/[email protected]
# - uses: bufbuild/buf-breaking-action@v1
# with:
# input: "proto"
# against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
break-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ node_modules
swagger-proto
tmp-swagger-gen
.devenv
.secrets
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
(import ./nix/devshell.nix { inherit pkgs; })
(import ./nix/devshell.nix { inherit pkgs pkgsUnstable; })
];
};
};
Expand Down
11 changes: 10 additions & 1 deletion nix/devshell.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{ pkgs, ... }:
{ pkgs, pkgsUnstable, ... }:
{
dotenv.enable = true;

packages = with pkgs;
[
pkgsUnstable.act
gh

yarn
nodejs

Expand Down Expand Up @@ -33,8 +35,15 @@
scripts.ci-proto.exec = ''
set -e
make clean
make proto-all
make proto-swagger-gen
# it gets updated every time, so we are ignoring this one
git checkout -- client/docs/statik/statik.go
echo "Checking diff..."
if ! git diff --exit-code; then
echo "Directory is not clean after swagger generation"
exit 1
Expand Down

0 comments on commit eb5e36b

Please sign in to comment.