Skip to content

Commit

Permalink
Fix anchor CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Aursen committed Feb 21, 2024
1 parent 6152f89 commit 1ac4fba
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/actions/setup-solana/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Setup Solana"
description: "Setup Solana"
runs:
using: "composite"
steps:
- uses: actions/cache@v4
name: Cache Solana Tool Suite
id: cache-solana
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-${{ runner.os }}-v${{ env.SOLANA_CLI_VERSION }}
- uses: nick-fields/retry@v3
if: steps.cache-solana.outputs.cache-hit != 'true'
with:
retry_wait_seconds: 300
timeout_minutes: 2
max_attempts: 10
retry_on: error
shell: bash
command: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_CLI_VERSION }}/install)"
- run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
shell: bash
- run: solana-keygen new --no-bip39-passphrase
shell: bash
- run: solana config set --url localhost
shell: bash
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
branches:
- main

env:
SOLANA_CLI_VERSION: 1.18.2
ANCHOR_CLI_VERSION: 0.29.0

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
container: backpackapp/build:v0.29.0
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -24,13 +27,21 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup Solana CLI
uses: ./.github/actions/setup-solana/
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup Anchor CLI
run: npm install -g @coral-xyz/anchor-cli@${{ env.ANCHOR_CLI_VERSION }}
- name: Cargo tests
run: cargo test
env:
RUST_BACKTRACE: 1
- name: Anchor tests
run: anchor test
timeout-minutes: 10

lints:
name: Lints
Expand Down

0 comments on commit 1ac4fba

Please sign in to comment.