release: 0.3.1 (#58) #230
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| env: | |
| solana_version: v3.1.13 | |
| anchor_version: 0.31.1 | |
| rust_version: 1.93.0 | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| solana_path: ${{ steps.setup-solana.outputs.solana_path }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install essentials | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config build-essential libudev-dev | |
| npm install --global yarn | |
| - name: Install Rust | |
| shell: "bash" | |
| run: | | |
| rustup toolchain install ${{ env.rust_version }} --profile minimal | |
| rustup default ${{ env.rust_version }} | |
| - uses: actions/cache@v4 | |
| name: cache solana cli | |
| id: cache-solana | |
| with: | |
| path: | | |
| ~/.cache/solana/ | |
| ~/.local/share/solana/ | |
| key: solana-${{ runner.os }}-v0001-${{ env.solana_version }} | |
| - name: install solana | |
| if: steps.cache-solana.outputs.cache-hit != 'true' | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/${{ env.solana_version }}/install)" | |
| - name: Set Solana path | |
| id: setup-solana | |
| run: | | |
| echo "solana_path=$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_OUTPUT | |
| export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH" | |
| solana --version | |
| lint: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| shell: "bash" | |
| run: | | |
| rustup toolchain install ${{ env.rust_version }} --profile minimal | |
| rustup default ${{ env.rust_version }} | |
| rustup component add rustfmt clippy --toolchain ${{ env.rust_version }} | |
| - name: Run fmt | |
| run: cargo fmt -- --check | |
| - name: Run clippy | |
| run: cargo clippy -- --deny=warnings | |
| test: | |
| needs: [setup, lint] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| shell: "bash" | |
| run: | | |
| rustup toolchain install ${{ env.rust_version }} --profile minimal | |
| rustup default ${{ env.rust_version }} | |
| - uses: actions/cache@v4 | |
| name: cache solana cli | |
| id: cache-solana | |
| with: | |
| path: | | |
| ~/.cache/solana/ | |
| ~/.local/share/solana/ | |
| key: solana-${{ runner.os }}-v0001-${{ env.solana_version }} | |
| - name: setup solana | |
| run: | | |
| export PATH="${{ needs.setup.outputs.solana_path }}:$PATH" | |
| solana --version | |
| solana-keygen new --silent --no-bip39-passphrase | |
| - name: run build (all test-combinations) | |
| run: | | |
| export PATH="${{ needs.setup.outputs.solana_path }}:$PATH" | |
| cargo --version | |
| cargo build-sbf --version | |
| bash sdk/scripts/test-combinations.sh --no-color | |
| cargo build | |
| cd program && cargo build-sbf --features test-sbf | |
| - name: run integration tests | |
| working-directory: program/tests/integration/use-randomness | |
| run: | | |
| export PATH="${{ needs.setup.outputs.solana_path }}:$PATH" | |
| solana --version | |
| cargo build-sbf --version | |
| cargo install --locked --version ${{ env.anchor_version }} anchor-cli | |
| anchor --version | |
| yarn install --frozen-lockfile | |
| anchor test | |
| - name: run tests | |
| run: | | |
| export PATH="${{ needs.setup.outputs.solana_path }}:$PATH" | |
| cargo --version | |
| cargo test-sbf --version | |
| cargo test-sbf --features test-sbf |