Merge pull request #36 from yuma140902/template-engine #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
name: Build and Test on ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# [Rust プロジェクトの GitHub Actions で incremental build をするためのテクニック](https://zenn.dev/kt3k/articles/d557cc874961ab) | |
- name: Setup | Cache | |
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') }} | |
- name: Setup | Python3 | |
uses: actions/setup-python@v4 | |
- name: Setup | Restore mtime | |
run: python3 ./.github/scripts/git-restore-mtime.py | |
- name: Setup | cargo-all-features | |
uses: baptiste0928/cargo-install@v1.3.0 | |
with: | |
crate: cargo-all-features | |
- name: Build | |
run: cargo build-all-features --verbose | |
- name: Test | |
run: cargo test | |
- name: Format | |
run: cargo fmt --all -- --check | |
- name: Lint | |
run: cargo clippy --tests --workspace -- -D warnings |