Ver Fonte

try action fix

Ayush há 11 meses atrás
pai
commit
f5771464d4

+ 1 - 1
.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: |

+ 10 - 1
.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

+ 1 - 1
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"

+ 0 - 36
basics/hello-solana/native/tests/test.ts

@@ -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);
-  });
-});

+ 1 - 1
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"

+ 0 - 36
basics/hello-solana/steel/tests/test.ts

@@ -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);
-  });
-});