---
name: Task - Build Rust
on:
workflow_dispatch:
workflow_call:
jobs:
rust_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Cargo registry and git trees
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-cargo
- name: Setup rust toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: rustup show
- name: Build the project
run: |
cargo build --release