Update rust.yml #17
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 Rust -> Check code and make git version | |
on: | |
push: | |
branches: ["master"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
make-cache: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Make Cache | |
- uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: true | |
cache-all-crates: true | |
shared-key: tests | |
- name: Set Toolchain | |
uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- name: Job | |
run: cargo check -r -F full --locked | |
Clippy: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Load Cache | |
uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
shared-key: tests | |
- name: Set Toolchain | |
uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- name: Job | |
run: cargo clippy --all-targets -F full --locked -r -- -D warnings | |
Doc-check: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Load Cache | |
uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
shared-key: tests | |
- name: Set toolchain | |
- uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- name: Job | |
run: cargo test -F full --doc -r --locked | |
Lib-check: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Load Cache | |
uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
shared-key: tests | |
- name: Set Toolchain | |
uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- name: Job | |
run: cargo test -p shuller -F full -r --lib --locked | |
Lib-and-Tests-check: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Load Cache | |
uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
shared-key: tests | |
- name: Set Toolchain | |
uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- name: Job | |
run: cargo test -p shuller tests -F full -r --locked | |
Make-Tag: | |
needs: | |
- Clippy | |
- Doc-check | |
- Lib-check | |
- Lib-and-Tests-check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Save version | |
run: | | |
version=$(grep 'version =' Cargo.toml | head -n 1 | cut -d '"' -f 2) | |
echo $version | |
- name: Configure Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Make tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git tag "v$version" | |
git push origin "v$version" | |