Skip to content

Commit

Permalink
try building w anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
ngundotra committed Jul 25, 2023
1 parent 555f984 commit 61554d0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pull-request-account-compression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- ".github/workflows/pull-request-account-compression.yml"

jobs:
cargo-test-sbf:
anchor-build-account-compression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -27,6 +27,8 @@ jobs:
echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV
source ci/solana-version.sh
echo "SOLANA_VERSION=$solana_version" >> $GITHUB_ENV
source ci/anchor-cliversion.sh
echo "ANCHOR_CLI_VERSION=$anchor_cli_version" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -39,7 +41,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE}}
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUST_STABLE }}

- uses: actions/cache@v2
with:
Expand All @@ -55,7 +57,7 @@ jobs:
- name: Install dependencies
run: |
./ci/install-build-deps.sh
./ci/install-program-deps.sh
./ci/program-anchor-build.sh
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
- name: Upload programs
Expand Down
34 changes: 34 additions & 0 deletions ci/anchor-cliversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This file maintains the solana versions for use by CI.
#
# Obtain the environment variables without any automatic updating:
# $ source ci/anchor-cli-version.sh
#
# Obtain the environment variables and install update:
# $ source ci/anchor-cli-version.sh install

# Then to access the anchor version:
# $ echo "$anchor_cli_version"
#

if [[ -n $ANCHOR_CLI_VERSION ]]; then
anchor_cli_version="$ANCHOR_CLI_VERSION"
else
anchor_cli_version=v0.28.0
fi

export anchor_cli_version="$anchor_cli_version"
# export PATH="$HOME"/.local/share/solana/install/active_release/bin:"$PATH"

if [[ -n $1 ]]; then
case $1 in
install)
echo "yeehaw"
cargo install --git https://github.com/coral-xyz/anchor --tag $anchor_cli_version anchor-cli --locked
anchor --version
;;
*)
echo "solana-version.sh: Note: ignoring unknown argument: $1" >&2
;;
esac
fi
14 changes: 14 additions & 0 deletions ci/program-anchor-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

source ci/rust-version.sh stable
echo "installing solana"
source ci/solana-version.sh install
echo "installing anchor"
source ci/anchor-cliversion.sh install

set -x

echo "cargo installing anchor"
anchor build account-compression

0 comments on commit 61554d0

Please sign in to comment.