Skip to content

Merge pull request #740 from RickyLB/fix/gh_actions #657

Merge pull request #740 from RickyLB/fix/gh_actions

Merge pull request #740 from RickyLB/fix/gh_actions #657

Workflow file for this run

name: Rust CI
on:
pull_request:
push:
branches: ['main']
jobs:
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Add `rustfmt` to toolchain
run: rustup +nightly component add rustfmt
- name: Format
run: cargo +nightly fmt --check
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
sdk/rust
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: cargo check --workspace
test:
needs: ['check']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Start the local node
run: npx @hashgraph/[email protected] start -d --network local
- name: "Create env file"
run: |
touch .env
echo TEST_OPERATOR_KEY="302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" >> .env
echo TEST_OPERATOR_ID="0.0.2" >> .env
echo TEST_HEDERA_NETWORK="localhost" >> .env
echo TEST_RUN_NONFREE="1" >> .env
cat .env
- name: Test
run: cargo test --workspace
- name: Stop the local node
run: npx @hashgraph/[email protected] stop