Skip to content

Merge pull request #34 from SoptikHa2/setup-ci #3

Merge pull request #34 from SoptikHa2/setup-ci

Merge pull request #34 from SoptikHa2/setup-ci #3

Workflow file for this run

name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
lint:
name: Check code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: dtolnay/rust-toolchain@master
name: Set up toolchain
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
name: Cache toolchain and dependencies
- uses: actions-rs/cargo@v1
name: Check code with cargo fmt
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
name: Check code with cargo clippy
with:
command: clippy
args: --all-targets -- -D warnings