Rust #72
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: Format | |
run: cargo fmt --check | |
- name: Linter | |
run: cargo clippy -- -Dwarnings --verbose | |
- name: Checker | |
run: cargo check --verbose | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: cargo test --verbose | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --verbose | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
needs: [lint, test, build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate Docs | |
run: cargo doc --examples --verbose | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
needs: [build] | |
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/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |