diff --git a/.github/workflows/solana.yml b/.github/workflows/solana.yml index 37107374..8309254d 100644 --- a/.github/workflows/solana.yml +++ b/.github/workflows/solana.yml @@ -59,9 +59,9 @@ jobs: node-version: "20.11.0" solana-cli-version: "1.18.15" anchor-version: "0.30.1" - - name: Set default Rust toolchain - run: rustup default stable - working-directory: ./solana + # - name: Set default Rust toolchain + # run: rustup default stable + # working-directory: ./solana - name: make check-idl run: make check-idl working-directory: ./solana @@ -80,9 +80,9 @@ jobs: node-version: "20.11.0" solana-cli-version: "1.18.15" anchor-version: "0.30.1" - - name: Set default Rust toolchain - run: rustup default stable - working-directory: ./solana + # - name: Set default Rust toolchain + # run: rustup default stable + # working-directory: ./solana - name: make anchor-test run: make anchor-test working-directory: ./solana @@ -101,9 +101,9 @@ jobs: node-version: "20.11.0" solana-cli-version: "1.18.15" anchor-version: "0.30.1" - - name: Set default Rust toolchain - run: rustup default stable - working-directory: ./solana + # - name: Set default Rust toolchain + # run: rustup default stable + # working-directory: ./solana - name: make anchor-test-upgrade run: make anchor-test-upgrade working-directory: ./solana diff --git a/solana/Makefile b/solana/Makefile index 0d72bd4f..1def5a75 100644 --- a/solana/Makefile +++ b/solana/Makefile @@ -7,6 +7,12 @@ CLONED_MAINNET_PROGRAMS=\ ts/tests/artifacts/mainnet_cctp_token_messenger_minter.so \ ts/tests/artifacts/mainnet_cctp_message_transmitter.so +PROGRAM_NAMES=matching_engine token_router upgrade_manager + +### Building the IDL requires a nightly build. We arbitrarily chose the same +### date as the release of Anchor 0.30.1. +IDL_TOOLCHAIN=nightly-2024-06-20 + .PHONY: all all: check @@ -42,11 +48,15 @@ endif .PHONY: anchor-test-setup anchor-test-setup: node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS) - anchor build -- --features integration-test + anchor build --no-idl -- --features integration-test .PHONY: idl idl: - anchor build -- --features localnet + mkdir -p target/idl target/types + for program in $(PROGRAM_NAMES); do \ + RUSTUP_TOOLCHAIN=$(IDL_TOOLCHAIN) anchor idl build -p $$program -o target/idl/$$program.json; \ + anchor idl type -o target/types/$$program.ts target/idl/$$program.json; \ + done mkdir -p ts/src/idl/json mkdir -p ts/src/idl/ts cp -r target/idl/* ts/src/idl/json/ @@ -65,7 +75,7 @@ anchor-test: anchor-test-setup .PHONY: anchor-test-upgrade anchor-test-upgrade: node_modules ts/tests/artifacts $(CLONED_MAINNET_PROGRAMS) - anchor build -- --features testnet + anchor build --no-idl -- --features testnet cp target/deploy/matching_engine.so ts/tests/artifacts/new_testnet_matching_engine.so cp target/deploy/token_router.so ts/tests/artifacts/new_testnet_token_router.so cp target/deploy/upgrade_manager.so ts/tests/artifacts/testnet_upgrade_manager.so