From bb24115d2f7194cfd25f50023533d8d14926e999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabrielle=20Guimar=C3=A3es=20de=20Oliveira?= Date: Sat, 24 Feb 2024 16:31:42 -0300 Subject: [PATCH 1/3] ci: improve workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabrielle Guimarães de Oliveira --- .github/workflows/check.yml | 47 +++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 02ef91097..55e40fbe2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -15,34 +15,41 @@ 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 + - uses: actions/checkout@v4Z - - 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 code 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 && + - name: Check build for benchmarking + run: | + pushd node cargo check --features=runtime-benchmarks --release From 1d19a355d5a1eac66616dd8ac185c94dc9316eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabrielle=20Guimar=C3=A3es=20de=20Oliveira?= Date: Sat, 24 Feb 2024 16:32:58 -0300 Subject: [PATCH 2/3] ci: fix checkout version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabrielle Guimarães de Oliveira --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 55e40fbe2..f9723cf2d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,7 +20,7 @@ jobs: # 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@v4Z + - uses: actions/checkout@v4 - name: Setup Rust cache uses: Swatinem/rust-cache@v2 From f6b3b0a1f9e8694fd4143c5cb4f8792bb462f96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabrielle=20Guimar=C3=A3es=20de=20Oliveira?= Date: Sat, 24 Feb 2024 16:42:30 -0300 Subject: [PATCH 3/3] ci: install protoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabrielle Guimarães de Oliveira --- .github/workflows/check.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f9723cf2d..34ba6f8f0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -21,6 +21,12 @@ jobs: 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: Setup Rust cache uses: Swatinem/rust-cache@v2 @@ -36,7 +42,7 @@ jobs: command: fmt args: -- --check - - name: Check code errors + - name: Check Clippy errors uses: actions-rs/clippy-check@v1 env: SKIP_WASM_BUILD: 1 @@ -49,7 +55,7 @@ jobs: SKIP_WASM_BUILD: 1 run: cargo test - - name: Check build for benchmarking + - name: Check Build for Benchmarking run: | pushd node cargo check --features=runtime-benchmarks --release