Update rust.yml #16
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: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: true | |
cache-all-crates: true | |
- run: cargo check -r -F full --locked | |
Clippy: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
- uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- run: cargo clippy --all-targets -F full -r -- -D warnings --locked | |
Doc-check: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
- uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- run: cargo test -F full --doc -r --locked | |
Lib-check: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
- uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- run: cargo test -p shuller -F full -r --lib --locked | |
Lib-and-Tests-check: | |
needs: | |
- make-cache | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2.7.3 | |
with: | |
save-if: false | |
- uses: actions-rs/toolchain@v1.0.6 | |
with: | |
toolchain: stable | |
- run: cargo test -p shuller tests -F full -r --locked | |
take-version: | |
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" | |