Skip to content

Commit 566b45e

Browse files
Automatically generate Haskell bindings (#163)
* Automatically generate Haskell bindings Previously, the Haskell bindings became outdated as soon as we made changes to the SCIP spec. This PR adds Haskell binding generation to the `proto-generate.sh` script so that the Haskell bindings are automatically kept up-to-date as we make changes to the spec. * Update dev/proto-generate.sh Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com> * Run cabal update in CI * Use older version of GHC * Update Haskell CI workflow to only build existing code --------- Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
1 parent 1346f26 commit 566b45e

File tree

6 files changed

+1111
-872
lines changed

6 files changed

+1111
-872
lines changed

.github/workflows/haskell.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,6 @@ jobs:
1919
with:
2020
ghc-version: '8.10'
2121
cabal-version: 'latest'
22-
- name: Install additional tools
23-
run: |
24-
sudo apt-get update
25-
sudo apt install -y unzip curl
26-
- name: Install protoc
27-
run: |
28-
PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
29-
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/"$PROTOC_ZIP"
30-
unzip -o "$PROTOC_ZIP" -d "$HOME/.protoc" bin/protoc
31-
unzip -o "$PROTOC_ZIP" -d "$HOME/.protoc" 'include/*'
32-
echo "$HOME/.protoc/bin" >> "$GITHUB_PATH"
33-
- name: Build proto-lens-protoc wrapper
34-
run: cabal install proto-lens-protoc --ghc-options='-j2 +RTS -A32m'
35-
working-directory: bindings/haskell
36-
- name: Generate Haskell
37-
run: protoc --plugin=protoc-gen-haskell="$HOME/.cabal/bin/proto-lens-protoc" --haskell_out=src --proto_path=../.. scip.proto
38-
working-directory: bindings/haskell
3922
- name: Build source
4023
run: cabal build --ghc-options='-j2 +RTS -A32m'
4124
working-directory: bindings/haskell

.github/workflows/protobuf.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17+
- name: Set up Haskell
18+
uses: haskell/actions/setup@v2
19+
with:
20+
ghc-version: '8.10'
21+
cabal-version: 'latest'
1722
- uses: ./.github/actions/asdf
1823
with:
1924
js: true

0 commit comments

Comments
 (0)