|
95 | 95 | cabal-store: ${{ steps.setup-haskell.outputs.cabal-store }} |
96 | 96 | cache-version: ${{ env.CABAL_CACHE_VERSION }} |
97 | 97 |
|
98 | | - - name: '[Linux] [cardano-rpc] Install buf tool' |
99 | | - if: runner.os == 'Linux' |
100 | | - run: | |
101 | | - curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-Linux-x86_64" -o "/usr/local/bin/buf" |
102 | | - chmod +x /usr/local/bin/buf |
103 | | -
|
104 | | - - name: '[Linux] [cardano-rpc] Install proto-lens-protoc tool' |
105 | | - if: runner.os == 'Linux' |
106 | | - run: cabal install proto-lens-protoc --installdir=$HOME/.local/bin |
107 | | - |
108 | | - - name: '[Linux] [cardano-rpc] Generate protobuf code' |
109 | | - if: runner.os == 'Linux' |
110 | | - working-directory: cardano-rpc |
111 | | - run: buf generate proto |
112 | | - |
113 | | - - name: '[Linux] [cardano-rpc] Check that generated files from proto definitions are up to date' |
114 | | - if: runner.os == 'Linux' |
115 | | - run: | |
116 | | - git add cardano-rpc/gen |
117 | | - if ! git diff --staged --quiet -- cardano-rpc/gen; then |
118 | | - echo "Generated files differ from repository files:" |
119 | | - git diff --staged --name-status -- cardano-rpc/gen |
120 | | - exit 1 |
121 | | - fi |
122 | | - echo "All generated files match repository files" |
123 | | -
|
124 | 98 | # Now we build. |
125 | 99 | - name: Build all |
126 | 100 | run: cabal build all --enable-tests |
@@ -149,14 +123,40 @@ jobs: |
149 | 123 | # with: |
150 | 124 | # limit-access-to-actor: true |
151 | 125 |
|
| 126 | + check-proto-gen: |
| 127 | + runs-on: ubuntu-latest |
| 128 | + steps: |
| 129 | + - uses: actions/checkout@v4 |
| 130 | + |
| 131 | + - uses: cachix/install-nix-action@v30 |
| 132 | + with: |
| 133 | + extra_nix_config: | |
| 134 | + accept-flake-config = true |
| 135 | +
|
| 136 | + - uses: rrbutani/use-nix-shell-action@v1 |
| 137 | + |
| 138 | + - name: Regenerate protobuf code |
| 139 | + working-directory: cardano-rpc |
| 140 | + run: buf generate proto |
| 141 | + |
| 142 | + - name: Check that generated files from proto definitions are up to date |
| 143 | + run: | |
| 144 | + git add cardano-rpc/gen |
| 145 | + if ! git diff --staged --quiet -- cardano-rpc/gen; then |
| 146 | + echo "Generated files differ from repository files:" |
| 147 | + git diff --staged --name-status -- cardano-rpc/gen |
| 148 | + exit 1 |
| 149 | + fi |
| 150 | + echo "All generated files match repository files" |
| 151 | +
|
152 | 152 | build-complete: |
153 | | - needs: [build] |
| 153 | + needs: [build, check-proto-gen] |
154 | 154 | if: ${{ always() }} |
155 | 155 | runs-on: ubuntu-latest |
156 | 156 | steps: |
157 | 157 | - name: Check if any previous job failed |
158 | 158 | run: | |
159 | | - if [[ "${{ needs.build.result }}" == "failure" ]]; then |
| 159 | + if [[ "${{ needs.build.result }}" == "failure" || "${{ needs.check-proto-gen.result }}" == "failure" ]]; then |
160 | 160 | # this ignores skipped dependencies |
161 | 161 | echo 'Required jobs failed to build.' |
162 | 162 | exit 1 |
|
0 commit comments