Rust #98
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: Rust | |
on: | |
push: | |
branches: [develop, master] | |
pull_request: | |
branches: [develop, master] | |
schedule: | |
- cron: 0 0 * * 0 | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
name: Lint & Formatting Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Format | |
run: cargo fmt --check | |
- name: Checker | |
run: cargo check --verbose | |
- name: Linter | |
run: cargo clippy -- -Dwarnings | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Run tests | |
run: cargo test --verbose | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Build | |
run: cargo build --verbose | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
needs: [lint, test, build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Generate Docs | |
run: cargo doc --examples --verbose | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
needs: [build] | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarqube-scan-action@v4.2.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ env.SONAR_TOKEN }} |