[Rust] Github Action: Unit test ์คํฌ๋ฆฝํธ
name: Cargo Build & Test
on:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose
PR์ ๋ฐ์ํด์ ์ ์ฒด ์ปดํ์ผ, ์ ์ฒด ํ
์คํธ๋ฅผ ๋๋ฆฌ๋ ์ํฌํ๋ก ์คํฌ๋ฆฝํธ๋ค.
๊ทธ๋ฆฌ๊ณ ๋น๋์บ์ ์ธํ
์ ํด๋์ toml ๋ณ๊ฒฝ ์ด์ ๊น์ง๋ ์ฆ๋ถ ๋น๋๊ฐ ๋ ๊ฒ์ด๋ค.
์ ๋๋ก ๋ฐ์ด๋ฃ๊ณ ๋๋ฆฌ๋ฉด
ํ
์คํธ๋ฅผ ์ด์ฌํ ๋๋ฆฐ๋ค.
๊ทธ๋ฆฌ๊ณ ๋ฌ์คํธ๋ ์ปดํ์ผ์ด ๋๋ฆฐ ํธ์ ์ํ๊ธฐ ๋๋ฌธ์ ๋น๋์บ์๊ฐ ๋์ฑ ์ค์ํ๋ค.
๋ด ๊ฒฝ์ฐ์๋ toml์ ๊ธฐ์ค ํค๋ก ์บ์๋ฅผ ๋ฃ์ด๋จ๋ค.
๋ด ๊ฒฝ์ฐ์๋ ๋น๋ ์บ์ ์ด์ ์๋ 1๋ถ์ด ๊ฑธ๋ ธ๊ณ
๋น๋์บ์๋ฅผ ๋ฃ๊ณ ๋ 20์ด๊ฐ ์ ๊ฑธ๋ ธ๋ค. ์บ์๋ง ํ๋ฉด ์ฌ๋งํด์ 1๋ถ ๋ด์ ์ฒ๋ฆฌํ ์ ์์ ๊ฒ์ด๋ค.