Skip to content

Refactor arch

Refactor arch #18

Workflow file for this run

name: Rust Checks
on:
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-lint-${{ hashFiles('**/Cargo.lock') }}
- name: Cache | Protoc
id: cache_protoc
uses: actions/cache@v3
with:
path: /opt/protoc
key: protoc-${{ runner.os }}-23.x
restore-keys: protoc-${{ runner.os }}-
- name: Install | Protoc
if: steps.cache_protoc.outputs.cache-hit != 'true'
run: |
mkdir -p /opt/protoc
cd /opt/protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
unzip protoc-23.4-linux-x86_64.zip -d /opt/protoc
- name: Add Protoc to PATH
run: echo "/opt/protoc/bin" >> $GITHUB_PATH
- name: Setup | Install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Setup | Disable rustup self-update
run: |
rustup set auto-self-update disable
- name: Setup | Toolchain (clippy)
run: |
rustup toolchain install stable --component clippy
rustup default stable
- name: Build | Clippy
run: |
cargo clippy --all-targets --no-default-features --features=static -- -D warnings
- name: Build | Rustfmt
run: cargo fmt -- --check
check:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.80.0 # MSRV
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-check-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
- name: Cache | Protoc
id: cache_protoc_check
uses: actions/cache@v3
with:
path: /opt/protoc
key: protoc-${{ runner.os }}-23.x
restore-keys: protoc-${{ runner.os }}-
- name: Install | Protoc
if: steps.cache_protoc_check.outputs.cache-hit != 'true'
run: |
mkdir -p /opt/protoc
cd /opt/protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
unzip protoc-23.4-linux-x86_64.zip -d /opt/protoc
- name: Add Protoc to PATH
run: echo "/opt/protoc/bin" >> $GITHUB_PATH
- name: Set PROTOC environment variable
run: echo "PROTOC=/opt/protoc/bin/protoc" >> $GITHUB_ENV
- name: Setup | Install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Setup | Disable rustup self-update
run: |
rustup set auto-self-update disable
- name: Setup | Rust
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Build | Check
run: cargo check --no-default-features --features=static