From 61554d03f175b5cb856aeeb821919608d0918fed Mon Sep 17 00:00:00 2001 From: ngundotra Date: Tue, 25 Jul 2023 16:43:14 -0400 Subject: [PATCH] try building w anchor --- .../pull-request-account-compression.yml | 8 +++-- ci/anchor-cliversion.sh | 34 +++++++++++++++++++ ci/program-anchor-build.sh | 14 ++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100755 ci/anchor-cliversion.sh create mode 100755 ci/program-anchor-build.sh diff --git a/.github/workflows/pull-request-account-compression.yml b/.github/workflows/pull-request-account-compression.yml index 483a21ae5e6..096d3ce082e 100644 --- a/.github/workflows/pull-request-account-compression.yml +++ b/.github/workflows/pull-request-account-compression.yml @@ -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 @@ -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: @@ -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: @@ -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 diff --git a/ci/anchor-cliversion.sh b/ci/anchor-cliversion.sh new file mode 100755 index 00000000000..ed97945032c --- /dev/null +++ b/ci/anchor-cliversion.sh @@ -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 diff --git a/ci/program-anchor-build.sh b/ci/program-anchor-build.sh new file mode 100755 index 00000000000..12679ede7b3 --- /dev/null +++ b/ci/program-anchor-build.sh @@ -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 \ No newline at end of file