Skip to content

Commit

Permalink
move interface test to rust workflow and clean up Anchor.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Dec 10, 2024
1 parent 137bb55 commit 3e179e7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 95 deletions.
87 changes: 0 additions & 87 deletions .github/workflows/relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,90 +63,3 @@ jobs:
/tmp/gotest.log
./race_coverage.txt
./integration_coverage.txt
get_projectserum_version:
name: Get ProjectSerum Version
runs-on: ubuntu-latest
outputs:
projectserum_version: ${{ steps.psversion.outputs.projectserum_version }}
steps:
- name: Checkout the repo
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Get ProjectSerum Version
id: psversion
uses: ./.github/actions/projectserum_version

build_wrapped_anchor_image:
name: build contract test image
runs-on: ubuntu-latest
needs: [get_projectserum_version]
defaults:
run:
working-directory: contracts
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: cache docker build image
id: cache-image
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: contracts/docker-build.tar
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}
- name: build & save image
if: steps.cache-image.outputs.cache-hit != 'true'
run: |
docker buildx build . -t chainlink-solana:build --build-arg ANCHOR_CLI=${{ needs.get_projectserum_version.outputs.projectserum_version }}
docker save chainlink-solana > docker-build.tar
relay_run_interface_tests:
name: Relay Run Interface Tests
runs-on: ubuntu-latest-8cores-32GB
needs: [get_projectserum_version, build_wrapped_anchor_image]
steps:
- name: Checkout sources
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Cache cargo target dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: contracts/target
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: cache docker build image
id: cache-image
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
fail-on-cache-miss: true
path: contracts/docker-build.tar
key: ${{ runner.os }}-docker-pnpm-build-${{ needs.get_projectserum_version.outputs.projectserum_version }}-${{ hashFiles('**/Cargo.lock') }}

- name: load cached image
run: |
docker load --input ./contracts/docker-build.tar
- name: Setup go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: "./integration-tests/go.mod"
check-latest: true
cache-dependency-path: "./integration-tests/go.sum"

- name: Install gotestloghelper
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest

- name: Install Solana CLI
run: ./scripts/install-solana-ci.sh

- name: Test Relay Interfaces
run: |
set -eoux pipefail
# compile artifacts
cd contracts && solana-keygen new -o id.json --no-bip39-passphrase
docker run -v "$(pwd)/../":/repo chainlink-solana:build bash -c "\
set -eoux pipefail &&\
RUSTUP_HOME=\"/root/.rustup\" &&\
FORCE_COLOR=1 &&\
cd /repo/contracts &&\
anchor build"
cd ..
make test_relay_integration
26 changes: 18 additions & 8 deletions contracts/Anchor.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
[toolchain]
anchor_version = "0.29.0"

[features]
seeds = false
skip-lint = false

[programs.localnet]
access_controller = "9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW"
contract-reader-interface = "6AfuXF6HapDUhQfE4nQG9C1SGtA1YjP3icaJyRfU4RyE"
log-read-test = "J1zQwrBNBngz26jRPNWsUSZMHJwBwpkoDitXRV95LdK4"
ocr_2 = "cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ"
store = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"

[registry]
url = "https://anchor.projectserum.com"

[provider]
cluster = "Localnet"
cluster = "localnet"
wallet = "id.json"
# wallet = "~/.config/solana/id.json"

[scripts]
test = "pnpm run test"

# [programs.mainnet]
# TODO: add pubkeys

# [programs.testnet]
# TODO: add pubkeys

# [programs.devnet]
# TODO: add pubkeys

[programs.localnet]
access_controller = "9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW"
contract-reader-interface = "6AfuXF6HapDUhQfE4nQG9C1SGtA1YjP3icaJyRfU4RyE"
log-read-test = "J1zQwrBNBngz26jRPNWsUSZMHJwBwpkoDitXRV95LdK4"
ocr_2 = "cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ" # need to rename the idl to satisfy anchor.js...
store = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"

0 comments on commit 3e179e7

Please sign in to comment.