Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add CI #18

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/actions/setup-rust/action.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,26 @@ description: "Setup Solana"
runs:
using: "composite"
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Cache Solana Tool Suite
id: cache-solana
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-${{ runner.os }}-v0000-${{ env.SOLANA_VERSION }}
- uses: nick-fields/retry@v2
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/${{ env.SOLANA_VERSION }}/install)"
- run: sh -c "$(curl -sSfL https://release.solana.com/${{ env.SOLANA_VERSION }}/install)"
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: |
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
shell: bash
- run: solana-install init ${{ env.SOLANA_VERSION }}
- run: solana-keygen new --no-bip39-passphrase
shell: bash
- run: solana config set --url localhost
shell: bash
224 changes: 0 additions & 224 deletions .github/workflows/bump-release.yaml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Lints and Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
SOLANA_CLI_VERSION: 1.18.2
ANCHOR_CLI_VERSION: 0.29.0

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.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
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy --all-targets -- -D warnings
Loading