Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improve workflows #19

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 31 additions & 18 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,47 @@ on:
jobs:
check:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: 3.20.1
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set-Up
run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2

- name: Install Rustup
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source ~/.cargo/env
rustup default stable
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly

- name: Check Build
run: |
SKIP_WASM_BUILD=1 cargo check --release
rustup set profile minimal
rustup show

- name: Ensure Rust formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: Check Clippy errors
uses: actions-rs/clippy-check@v1
env:
SKIP_WASM_BUILD: 1
with:
args: --color=always --timings -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: |
cargo test
env:
SKIP_WASM_BUILD: 1
run: cargo test

- name: Check Build for Benchmarking
run: >
pushd node &&
run: |
pushd node
cargo check --features=runtime-benchmarks --release
Loading