test: Add more tests for DustLost event in Energy pallet #714
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: Check and Test Code | |
on: | |
pull_request: | |
push: | |
branches: [ "main", "feature/*" ] | |
jobs: | |
test-code: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Get rustc version from file | |
run: | | |
echo "rustc_version=$(cat RUSTC_VERSION)" >> $GITHUB_ENV | |
# Steps taken from https://github.com/actions/cache/blob/master/examples.md#rust---cargo | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ env.rustc_version }} | |
components: rustfmt | |
target: wasm32-unknown-unknown | |
override: true | |
default: true | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- name: Check Code | |
run: cargo check --release | |
- name: Test Code | |
run: cargo test |