Skip to content

Commit

Permalink
Add CI to build contract (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
makarychev authored Jun 2, 2024
1 parent 0e217e7 commit b4aa584
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Solana_Build

on: [push]

jobs:
Test:
runs-on: [ubuntu-22.04]
env:
RUST_VERSION: 1.77.0
SOLANA_VERSION: 1.18.8
ANCHOR_VERSION: 0.29.0

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
components: rustfmt, clippy

- name: Install Solana
uses: metadaoproject/[email protected]
with:
solana-cli-version: ${{ env.SOLANA_VERSION }}

- name: Generate Key
run: solana-keygen new --no-passphrase

- name: Install Anchor
run: cargo install --git https://github.com/coral-xyz/anchor --tag v${{ env.ANCHOR_VERSION }} anchor-cli --locked

- name: Build
run: anchor build

- name: Install JS Dependencies
run: yarn install

- name: JS Tests
run: anchor test
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "/home/maksym/.config/solana/id.json"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run mocha -t 1000000 tests/*"
13 changes: 13 additions & 0 deletions ci/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e
cd "$(dirname "$0")/.."

set -x
solana config set --url localhost

solana-keygen new

anchor test

exit 0

0 comments on commit b4aa584

Please sign in to comment.