Modify name of project #88
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 | |
on: | |
- push | |
env: | |
CI: true | |
jobs: | |
check-spelling: | |
name: Check spelling | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: marshallku/actions/analyze/spell@master | |
build: | |
name: Build project | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: cargo build | |
test: | |
name: Test project | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Copy env file | |
run: cp .env.example .env | |
- name: Run test | |
run: cargo test | |
sonarqube: | |
name: Analyze with SonarQube | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Generate Clippy report | |
run: cargo clippy --message-format=json &> clippy-report.json || true | |
- name: Install tarpaulin | |
run: cargo install cargo-tarpaulin | |
- name: Copy env file | |
run: cp .env.example .env | |
- name: Measure coverage with tarpaulin | |
run: RUN_MODE=local cargo tarpaulin --ignore-tests --all-features --release --out Xml --timeout 300 | |
- uses: sonarsource/sonarqube-scan-action@v2 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
send-notification: | |
needs: [check-spelling, build, test, sonarqube] | |
if: ${{ failure() }} | |
uses: marshallku/actions/.github/workflows/send-notification.yml@master | |
with: | |
failed: ${{ contains(join(needs.*.result, ','), 'failure') }} | |
message: "CI job failed - push" | |
secrets: | |
url: ${{ secrets.DISCORD_WEBHOOK_URI }} |