BCF-2685: move LOOPP command from core #2655
Workflow file for this run
This file contains 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: rust | |
on: | |
pull_request: | |
defaults: | |
run: | |
working-directory: contracts | |
jobs: | |
get_projectserum_version: | |
name: Get ProjectSerum Version | |
runs-on: ubuntu-latest | |
outputs: | |
projectserum_version: ${{ steps.psversion.outputs.projectserum_version }} | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
- name: Get ProjectSerum Version | |
id: psversion | |
uses: ./.github/actions/projectserum_version | |
rust_run_anchor_tests: | |
name: Rust Run Anchor Tests | |
runs-on: ubuntu-latest | |
needs: [get_projectserum_version] | |
container: | |
image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} | |
env: | |
RUSTUP_HOME: "/root/.rustup" | |
FORCE_COLOR: 1 | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target dir | |
uses: actions/[email protected] | |
with: | |
path: contracts/target | |
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- run: solana-keygen new -o id.json --no-bip39-passphrase | |
- name: Compile typescript client | |
run: | | |
cd ../ts | |
yarn install --frozen-lockfile | |
yarn build | |
- run: yarn install --frozen-lockfile | |
- run: anchor test | |
- run: | | |
cd examples/hello-world | |
yarn install --frozen-lockfile | |
anchor test | |
rust_lint: | |
name: Rust Lint | |
runs-on: ubuntu-latest | |
needs: [get_projectserum_version] | |
container: | |
image: projectserum/build:${{ needs.get_projectserum_version.outputs.projectserum_version }} | |
env: | |
RUSTUP_HOME: "/root/.rustup" | |
FORCE_COLOR: 1 | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target dir | |
uses: actions/[email protected] | |
with: | |
path: contracts/target | |
key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- run: cargo check | |
- run: cargo clippy -- -D warnings |