Skip to content

CI を導入

CI を導入 #3

Workflow file for this run

name: Cargo Test
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo directories
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-test-
- name: Fetch dependencies
run: cargo fetch --locked
- name: Run cargo test
run: cargo test --workspace --all-targets --locked