From f5771464d4207ad6a5cb7a7c94a0154c8746df74 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 5 Nov 2024 21:07:28 +0530 Subject: [PATCH] try action fix --- .github/workflows/solana-native.yml | 2 +- .github/workflows/steel.yml | 11 +++++++- basics/hello-solana/native/package.json | 2 +- basics/hello-solana/native/tests/test.ts | 36 ------------------------ basics/hello-solana/steel/package.json | 2 +- basics/hello-solana/steel/tests/test.ts | 36 ------------------------ 6 files changed, 13 insertions(+), 76 deletions(-) delete mode 100644 basics/hello-solana/native/tests/test.ts delete mode 100644 basics/hello-solana/steel/tests/test.ts diff --git a/.github/workflows/solana-native.yml b/.github/workflows/solana-native.yml index 9efd0d64..262a4db6 100644 --- a/.github/workflows/solana-native.yml +++ b/.github/workflows/solana-native.yml @@ -36,7 +36,7 @@ jobs: native: - added|modified: '**/native/**' workflow: - - added|modified: '.github/workflows/native.yml' + - added|modified: '.github/workflows/solana-native.yml' - name: Analyze Changes id: analyze run: | diff --git a/.github/workflows/steel.yml b/.github/workflows/steel.yml index 41b2c52f..fa120ff9 100644 --- a/.github/workflows/steel.yml +++ b/.github/workflows/steel.yml @@ -186,10 +186,19 @@ jobs: - name: Build and Test with Stable run: | source build_and_test.sh - solana block solana -V rustc -V process_projects "stable" + - name: Test with Solana 1.18.17 + uses: heyAyushh/setup-solana@v5.4 + with: + solana-cli-version: 1.18.17 + - name: Build and Test with 1.18.17 + run: | + source build_and_test.sh + solana -V + rustc -V + process_projects "1.18.17" - name: Set failed projects output id: set-failed diff --git a/basics/hello-solana/native/package.json b/basics/hello-solana/native/package.json index e772d7dc..76cd4def 100644 --- a/basics/hello-solana/native/package.json +++ b/basics/hello-solana/native/package.json @@ -1,6 +1,6 @@ { "scripts": { - "test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts", + "test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/index.test.ts", "build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test", "build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so", "deploy": "solana program deploy ./program/target/so/hello_solana_program.so" diff --git a/basics/hello-solana/native/tests/test.ts b/basics/hello-solana/native/tests/test.ts deleted file mode 100644 index ec7daa61..00000000 --- a/basics/hello-solana/native/tests/test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { describe, test } from 'node:test'; -import { PublicKey, Transaction, TransactionInstruction } from '@solana/web3.js'; -import { assert } from 'chai'; -import { start } from 'solana-bankrun'; - -describe('hello-solana', async () => { - // load program in solana-bankrun - const PROGRAM_ID = PublicKey.unique(); - const context = await start([{ name: 'hello_solana_program', programId: PROGRAM_ID }], []); - const client = context.banksClient; - const payer = context.payer; - - test('Say hello!', async () => { - const blockhash = context.lastBlockhash; - // We set up our instruction first. - const ix = new TransactionInstruction({ - keys: [{ pubkey: payer.publicKey, isSigner: true, isWritable: true }], - programId: PROGRAM_ID, - data: Buffer.alloc(0), // No data - }); - - const tx = new Transaction(); - tx.recentBlockhash = blockhash; - tx.add(ix).sign(payer); - - // Now we process the transaction - const transaction = await client.processTransaction(tx); - - assert(transaction.logMessages[0].startsWith(`Program ${PROGRAM_ID}`)); - assert(transaction.logMessages[1] === 'Program log: Hello, Solana!'); - assert(transaction.logMessages[2] === `Program log: Our program's Program ID: ${PROGRAM_ID}`); - assert(transaction.logMessages[3].startsWith(`Program ${PROGRAM_ID} consumed`)); - assert(transaction.logMessages[4] === `Program ${PROGRAM_ID} success`); - assert(transaction.logMessages.length === 5); - }); -}); diff --git a/basics/hello-solana/steel/package.json b/basics/hello-solana/steel/package.json index f054a368..7b16847c 100644 --- a/basics/hello-solana/steel/package.json +++ b/basics/hello-solana/steel/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "hello world with steel framework for solana", "scripts": { - "test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts", + "test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/index.test.ts", "build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test", "build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so", "deploy": "solana program deploy ./program/target/so/hello_solana_program.so" diff --git a/basics/hello-solana/steel/tests/test.ts b/basics/hello-solana/steel/tests/test.ts deleted file mode 100644 index 4e3a0453..00000000 --- a/basics/hello-solana/steel/tests/test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { describe, test } from 'node:test'; -import { PublicKey, Transaction, TransactionInstruction } from '@solana/web3.js'; -import { assert } from 'chai'; -import { start } from 'solana-bankrun'; - -describe('hello-solana', async () => { - // load program in solana-bankrun - const PROGRAM_ID = PublicKey.unique(); - const context = await start([{ name: 'steel_hello_solana', programId: PROGRAM_ID }], []); - const client = context.banksClient; - const payer = context.payer; - - test('Say hello!', async () => { - const blockhash = context.lastBlockhash; - // We set up our instruction first. - const ix = new TransactionInstruction({ - keys: [{ pubkey: payer.publicKey, isSigner: true, isWritable: true }], - programId: PROGRAM_ID, - data: Buffer.alloc(0), // No data - }); - - const tx = new Transaction(); - tx.recentBlockhash = blockhash; - tx.add(ix).sign(payer); - - // Now we process the transaction - const transaction = await client.processTransaction(tx); - - assert(transaction.logMessages[0].startsWith(`Program ${PROGRAM_ID}`)); - assert(transaction.logMessages[1] === 'Program log: Hello, Solana!'); - assert(transaction.logMessages[2] === `Program log: Our program's Program ID: ${PROGRAM_ID}`); - assert(transaction.logMessages[3].startsWith(`Program ${PROGRAM_ID} consumed`)); - assert(transaction.logMessages[4] === `Program ${PROGRAM_ID} success`); - assert(transaction.logMessages.length === 5); - }); -});