Skip to content

Add workflows for all languages #2

Add workflows for all languages

Add workflows for all languages #2

Workflow file for this run

name: Rust cargo
on:
push:
branches:
- master
- main
paths:
- "**.rs"
- "rust/Cargo.lock"
- "rust/Cargo.toml"
- ".github/workflows/rust.yml"
pull_request:
paths:
- "**.rs"
- "rust/Cargo.lock"
- "rust/Cargo.toml"
- ".github/workflows/rust.yml"
env:
CARGO_TERM_COLOR: always
jobs:
rust:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
working-directory: rust
run: cargo build --verbose
- name: Run tests
working-directory: rust
run: cargo test
- name: Check formatting
working-directory: rust
run: cargo fmt --check --verbose
- name: Lint
working-directory: rust
# exit non-zero if there are any warnings
# https://doc.rust-lang.org/stable/clippy/usage.html
run: cargo clippy -- -Dwarnings