@@ -52,31 +52,31 @@ jobs:
5252 cp .env.example .env
5353 sed -i 's/YOUR_GITHUB_TOKEN/${{ github.token }}/g' .env
5454 - run : cargo test
55- # sonarqube:
56- # name: Analyze with SonarQube
57- # runs-on: ubuntu-latest
58- # if: github.ref == 'refs/heads/master'
59- # steps:
60- # - uses: actions/checkout@v4
61- # with:
62- # fetch-depth: 0
63- # - uses: actions-rust-lang/setup-rust-toolchain@v1
64- # - name: Install Clippy
65- # run: rustup component add clippy
66- # - name: Generate Clippy report
67- # run: cargo clippy --message-format=json &> clippy-report.json || true
68- # - name: Install tarpaulin
69- # run: cargo install cargo-tarpaulin
70- # - name: Setup env
71- # run: |
72- # cp .env.example .env
73- # sed -i 's/YOUR_GITHUB_TOKEN/${{ github.token }}/g' .env
74- # - name: Measure coverage with tarpaulin
75- # run: RUN_MODE=local cargo tarpaulin --ignore-tests --all-features --release --out Xml --timeout 300
76- # - uses: sonarsource/sonarqube-scan-action@v2
77- # env:
78- # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
79- # SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
55+ sonarqube :
56+ name : Analyze with SonarQube
57+ runs-on : ubuntu-latest
58+ if : github.ref == 'refs/heads/master'
59+ steps :
60+ - uses : actions/checkout@v4
61+ with :
62+ fetch-depth : 0
63+ - uses : actions-rust-lang/setup-rust-toolchain@v1
64+ - name : Install Clippy
65+ run : rustup component add clippy
66+ - name : Generate Clippy report
67+ run : cargo clippy --message-format=json &> clippy-report.json || true
68+ - name : Install tarpaulin
69+ run : cargo install cargo-tarpaulin
70+ - name : Setup env
71+ run : |
72+ cp .env.example .env
73+ sed -i 's/YOUR_GITHUB_TOKEN/${{ github.token }}/g' .env
74+ - name : Measure coverage with tarpaulin
75+ run : RUN_MODE=local cargo tarpaulin --ignore-tests --all-features --release --out Xml --timeout 300
76+ - uses : sonarsource/sonarqube-scan-action@v2
77+ env :
78+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
79+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST_URL }}
8080 docker :
8181 name : Deploy image
8282 runs-on : ubuntu-latest
@@ -124,7 +124,7 @@ jobs:
124124 rm -rf /tmp/.buildx-cache
125125 mv /tmp/.buildx-cache-new /tmp/.buildx-cache
126126 send-notification :
127- needs : [check-spell, check-format, build, test, docker]
127+ needs : [check-spell, check-format, build, test, sonarqube, docker]
128128 if : ${{ failure() }}
129129 uses : marshallku/actions/.github/workflows/send-notification.yml@master
130130 with :
0 commit comments