Adjusts POW and BURN based on a moving average (clean) (#158) #179
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 build, benchmarks, and tests | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
## | |
on: | |
## | |
# Run automatically for any push that changes Rust file(s) | |
push: | |
branches: | |
- main | |
- $default-branch | |
paths: | |
- "**.rs" | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
## | |
# Run automatically for PRs against default/main branch if Rust files change | |
pull_request: | |
branches: | |
- main | |
- $default-branch | |
paths: | |
- "**.rs" | |
- "**/Cargo.toml" | |
- "**/Cargo.lock" | |
## Allow running workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
verbose: | |
description: "Output more information when triggered manually" | |
required: false | |
default: "" | |
## | |
env: | |
CARGO_TERM_COLOR: always | |
VERBOSE: ${{ github.events.input.verbose }} | |
## | |
# | |
jobs: | |
check: | |
name: Tests targeting ${{ matrix.rust-target }} for OS ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
## | |
# Define multiple targets for builds and tests | |
strategy: | |
matrix: | |
rust-branch: | |
- nightly-2023-01-18 | |
rust-target: | |
- x86_64-unknown-linux-gnu | |
# - x86_64-apple-darwin | |
os: | |
- ubuntu-latest | |
# - macos-latest | |
include: | |
- os: ubuntu-latest | |
# - os: macos-latest | |
## | |
env: | |
RELEASE_NAME: development | |
RUSTFLAGS: -A warnings | |
RUSTV: ${{ matrix.rust-branch }} | |
RUST_BACKTRACE: full | |
RUST_BIN_DIR: target/${{ matrix.rust-target }} | |
SKIP_WASM_BUILD: 1 | |
TARGET: ${{ matrix.rust-target }} | |
## | |
steps: | |
- name: Check-out repository under $GITHUB_WORKSPACE | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt update && | |
sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler | |
- name: Install Rust ${{ matrix.rust-branch }} | |
uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: ${{ matrix.rust-branch }} | |
profile: minimal | |
- name: Utilize Rust shared cached | |
uses: Swatinem/rust-cache@v2.2.1 | |
with: | |
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }} | |
## TODO: maybe use `if` conditions in tests to target `--package <name>` | |
- name: Run tests | |
# timeout-minutes: 30 | |
run: | | |
cargo test --tests | |
- name: Run benchmarks | |
# timeout-minutes: 30 | |
run: | | |
pushd node && | |
cargo build --features=runtime-benchmarks --release | |
- name: Build executable | |
# timeout-minutes: 30 | |
run: | | |
cargo build --release | |