Update rust.yml #12
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 | |
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 | |
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 | |
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; | |
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; | |
take-version: | |
needs: | |
- Clippy | |
- Doc-check | |
- Lib-check | |
- Lib-and-Tests-check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Checkout | |
uses: actions/checkout@v4 | |
- name: Save version as artifact | |
run: | | |
version=$(grep 'version =' Cargo.toml | head -n 1 | cut -d '"' -f 2) | |
echo "version=$version" >> $GITHUB_ENV | |
echo "$version" > version.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: version | |
path: version.txt | |
create-version: | |
needs: take-version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Take version | |
id: version | |
run: | | |
version=$(grep value file | head -n 1) | |
echo "version=$version" >> $GITHUB_ENV | |
- 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: | |
VERSION: ${{ env.version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git tag "v$VERSION" | |
git push origin "v$VERSION" | |