Merge pull request #17 from blockworks-foundation/ci
github instead of travis for ci tests
This commit is contained in:
commit
4c3215c9b0
|
@ -0,0 +1,72 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, v*.*]
|
||||||
|
pull_request:
|
||||||
|
branches: [master, v*.*]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
SOLANA_VERSION: "1.9.1"
|
||||||
|
RUST_TOOLCHAIN: nightly-2021-12-15
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install Rust nightly
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
override: true
|
||||||
|
profile: minimal
|
||||||
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||||
|
components: rustfmt, clippy
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: Swatinem/rust-cache@v1
|
||||||
|
|
||||||
|
- name: Run fmt
|
||||||
|
run: cargo fmt -- --check
|
||||||
|
# The style and complexity lints have not been processed yet.
|
||||||
|
- name: Run clippy
|
||||||
|
run: cargo clippy -- --deny=warnings --allow=clippy::style --allow=clippy::complexity
|
||||||
|
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install Linux dependencies
|
||||||
|
run: sudo apt-get install -y pkg-config build-essential libudev-dev
|
||||||
|
- name: Install Rust nightly
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
override: true
|
||||||
|
profile: minimal
|
||||||
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: Swatinem/rust-cache@v1
|
||||||
|
|
||||||
|
# Install Solana
|
||||||
|
- name: Cache Solana binaries
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.cache/solana
|
||||||
|
key: ${{ runner.os }}-${{ env.SOLANA_VERSION }}
|
||||||
|
- name: Install Solana
|
||||||
|
run: |
|
||||||
|
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_VERSION }}/install)"
|
||||||
|
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
|
||||||
|
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
|
||||||
|
solana --version
|
||||||
|
echo "Generating keypair..."
|
||||||
|
solana-keygen new -o "$HOME/.config/solana/id.json" --no-passphrase --silent
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test-bpf
|
27
.travis.yml
27
.travis.yml
|
@ -1,27 +0,0 @@
|
||||||
dist: bionic
|
|
||||||
language: rust
|
|
||||||
rust:
|
|
||||||
- stable
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- NODE_VERSION="v17.0.1"
|
|
||||||
- SOLANA_VERSION="v1.8.0"
|
|
||||||
|
|
||||||
_defaults: &defaults
|
|
||||||
before_install:
|
|
||||||
- nvm install $NODE_VERSION
|
|
||||||
- sudo apt-get install -y pkg-config build-essential libudev-dev
|
|
||||||
- sh -c "$(curl -sSfL https://release.solana.com/${SOLANA_VERSION}/install)"
|
|
||||||
- export PATH="/home/travis/.local/share/solana/install/active_release/bin:$PATH"
|
|
||||||
- export NODE_PATH="/home/travis/.nvm/versions/node/${NODE_VERSION}/lib/node_modules/:${NODE_PATH}"
|
|
||||||
- yes | solana-keygen new
|
|
||||||
- cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- <<: *defaults
|
|
||||||
name: Runs the tests
|
|
||||||
script:
|
|
||||||
- yarn
|
|
||||||
- yarn test
|
|
||||||
- cargo test --lib
|
|
|
@ -102,7 +102,7 @@ pub fn configure_voting_mint(
|
||||||
deposit_scaled_factor,
|
deposit_scaled_factor,
|
||||||
lockup_scaled_factor,
|
lockup_scaled_factor,
|
||||||
lockup_saturation_secs,
|
lockup_saturation_secs,
|
||||||
grant_authority: grant_authority.unwrap_or(Pubkey::default()),
|
grant_authority: grant_authority.unwrap_or_default(),
|
||||||
padding: [0; 31],
|
padding: [0; 31],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue