Skip to content

Commit

Permalink
Anoma protobuf version fix (#3286)
Browse files Browse the repository at this point in the history
We need this fix for Anoma protobuf compilation when the protobuf
package changes.

See:
anoma/anoma#1801
  • Loading branch information
paulcadman authored Jan 20, 2025
1 parent b7870bb commit 2190ea3
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ jobs:
path: main
submodules: true

- name: Checkout Anoma repo
uses: actions/checkout@v4
with:
repository: anoma/anoma
ref: ${{ env.ANOMA_VERSION }}
path: anoma

- name: Add ~/.local/bin to PATH
run: |
mkdir -p "$HOME/.local/bin"
Expand All @@ -144,19 +151,22 @@ jobs:
id: cache-anoma
uses: actions/cache@v3
with:
path: |
${{ env.HOME }}/anoma
key: "${{ runner.os }}-anoma"
path: ${{ github.workspace }}/anoma
key: "${{ runner.os }}-${{ env.ANOMA_VERSION }}-anoma"

- name: Install Protobuf Elixir dependencies
shell: bash
working-directory: ${{ github.workspace }}/anoma
run: |
version=$(echo -n $(elixir -e "$(<mix.lock) |> Map.get(:protobuf) |> elem(2) |> IO.puts"))
echo "version: ${version}"
mix escript.install hex protobuf "$version" --force
- name: Build anoma
if: steps.cache-anoma.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/anoma
run: |
cd $HOME
git clone https://github.com/anoma/anoma.git
cd anoma
git checkout ${{ env.ANOMA_VERSION }}
mix local.hex --force
mix escript.install hex protobuf --force
echo "$HOME/.mix/escripts" >> $GITHUB_PATH
mix deps.get
mix compile
Expand Down Expand Up @@ -195,7 +205,7 @@ jobs:
- name: Set ANOMA_PATH
run: |
echo "ANOMA_PATH=$HOME/anoma" >> $GITHUB_ENV
echo "ANOMA_PATH=${{ github.workspace }}/anoma" >> $GITHUB_ENV
- run: echo "HOME=$HOME" >> $GITHUB_ENV
shell: bash
Expand Down

0 comments on commit 2190ea3

Please sign in to comment.