Skip to content

Commit

Permalink
SPL Stake Pool extract yield to stake account. Upload test artifacts …
Browse files Browse the repository at this point in the history
…in CI
  • Loading branch information
dankelleher committed Jan 24, 2024
1 parent caa212d commit 9df000e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cache-solana/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: install and Cache Solana binaries
runs:
using: composite
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-solana
with:
path: |
Expand Down
65 changes: 40 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/cache-solana

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'

- name: Cache node dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache rust
uses: Swatinem/rust-cache@v2
- name: Run fmt
Expand All @@ -53,11 +53,11 @@ jobs:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache rust
uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/cache-solana
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand All @@ -69,8 +69,8 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: target
path: target
name: target_deploy
path: target/deploy
if-no-files-found: error
retention-days: 1

Expand All @@ -79,11 +79,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache rust
uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/cache-solana
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand All @@ -99,14 +99,14 @@ jobs:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Cache node dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -126,14 +126,14 @@ jobs:
needs: yarn-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Cache node dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -150,19 +150,19 @@ jobs:
yarn lint
functional-test:
needs: [clippy-lint, yarn-lint, cargo-build]
needs: [yarn-build, cargo-build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Cache node dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -179,11 +179,17 @@ jobs:
- name: Download Rust build artifacts
uses: actions/download-artifact@v3
with:
name: target
path: .
name: target_deploy
path: ./target

- name: Download TS build artifacts
uses: actions/download-artifact@v3
with:
name: dists
path: packages/sdks

- uses: ./.github/actions/cache-solana
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand All @@ -193,11 +199,20 @@ jobs:
- name: run tests
run: |
ls target/deploy
ls packages/sdks/common/dist/cjs
#yarn anchor test --skip-build packages/tests/src/functional/beams/core.test.ts
yarn test
- uses: actions/upload-artifact@v3
- name: upload program logs
uses: actions/upload-artifact@v3
if: always()
with:
name: program-logs
path: .anchor/program-logs/*
path: .anchor/program-logs/*

- name: upload test report
uses: actions/upload-artifact@v3
if: always()
with:
name: test-report
path: mochawesome-report/*
6 changes: 3 additions & 3 deletions packages/tests/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ export const waitForNextEpoch = async (provider: AnchorProvider) => {
const startSlot = startingEpoch.slotIndex;
let subscriptionId = 0;

log("Waiting for epoch", nextEpoch);
logAtLevel("info")("Waiting for epoch", nextEpoch);

await new Promise((resolve) => {
subscriptionId = provider.connection.onSlotChange((slotInfo) => {
log("slot", slotInfo.slot, "startSlot", startSlot);
logAtLevel("trace")("slot", slotInfo.slot, "startSlot", startSlot);
if (slotInfo.slot % SLOTS_IN_EPOCH === 1 && slotInfo.slot > startSlot) {
void provider.connection.getEpochInfo().then((currentEpoch) => {
log("currentEpoch", currentEpoch);
logAtLevel("trace")("currentEpoch", currentEpoch);
if (currentEpoch.epoch === nextEpoch) {
resolve(slotInfo.slot);
}
Expand Down

0 comments on commit 9df000e

Please sign in to comment.