|
1 | 1 | name: Build
|
2 | 2 | on:
|
3 |
| - push: |
4 |
| - branches: |
5 |
| - - main |
6 |
| - pull_request: |
7 |
| - types: [opened, synchronize, reopened] |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + types: [opened, synchronize, reopened] |
8 | 8 | jobs:
|
9 |
| - sonarcloud: |
10 |
| - name: SonarCloud |
11 |
| - runs-on: ubuntu-latest |
12 |
| - steps: |
13 |
| - - uses: actions/checkout@v3 |
14 |
| - with: |
15 |
| - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis |
16 |
| - |
17 |
| - - name: Install Rust |
18 |
| - run: rustup update stable |
19 |
| - |
20 |
| - - name: Install cargo-llvm-cov |
21 |
| - uses: taiki-e/install-action@cargo-llvm-cov |
22 |
| - |
23 |
| - - name: Install Clippy |
24 |
| - run: rustup component add clippy |
25 |
| - |
26 |
| - - name: Install cargo-sonar and run Clippy |
27 |
| - run: | |
28 |
| - cargo install cargo-sonar |
29 |
| - cargo clippy --message-format json > clippy-report.json |
30 |
| - # cargo sonar --clippy --clippy-path clippy-report.json --deny --outdated --udeps |
31 |
| - cargo sonar --clippy --clippy-path clippy-report.json |
32 |
| -
|
33 |
| - - name: Generate code coverage |
34 |
| - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info |
35 |
| - |
36 |
| - - name: SonarCloud Scan |
37 |
| - uses: SonarSource/sonarcloud-github-action@master |
38 |
| - env: |
39 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
40 |
| - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
41 |
| - with: |
42 |
| - args: > |
43 |
| - -Dsonar.externalIssuesReportPaths=sonar-issues.json |
44 |
| - -Dcommunity.rust.lcov.reportPaths=lcov.info |
| 9 | + # test: |
| 10 | + # name: Coverage |
| 11 | + # runs-on: ubuntu-latest |
| 12 | + # container: |
| 13 | + # image: xd009642/tarpaulin:develop-nightly |
| 14 | + # options: --security-opt seccomp=unconfined |
| 15 | + # steps: |
| 16 | + # - name: Checkout repository |
| 17 | + # uses: actions/checkout@v2 |
| 18 | + |
| 19 | + # - name: Generate code coverage |
| 20 | + # run: | |
| 21 | + # cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml |
| 22 | + |
| 23 | + # - name: Upload to codecov.io |
| 24 | + # uses: codecov/codecov-action@v2 |
| 25 | + # with: |
| 26 | + # # token: ${{secrets.CODECOV_TOKEN}} # not required for public repos |
| 27 | + # fail_ci_if_error: true |
| 28 | + sonarcloud: |
| 29 | + name: SonarCloud |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + with: |
| 34 | + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis |
| 35 | + |
| 36 | + - name: Install Rust |
| 37 | + run: rustup update stable |
| 38 | + |
| 39 | + - name: Install cargo-llvm-cov |
| 40 | + uses: taiki-e/install-action@cargo-llvm-cov |
| 41 | + |
| 42 | + - name: Install Clippy |
| 43 | + run: rustup component add clippy |
| 44 | + |
| 45 | + - name: Install cargo-sonar and run Clippy |
| 46 | + run: | |
| 47 | + cargo install cargo-sonar |
| 48 | + cargo clippy --message-format json > clippy-report.json |
| 49 | + # cargo sonar --clippy --clippy-path clippy-report.json --deny --outdated --udeps |
| 50 | + cargo sonar --clippy --clippy-path clippy-report.json |
| 51 | +
|
| 52 | + - name: Generate code coverage |
| 53 | + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info |
| 54 | + |
| 55 | + - name: SonarCloud Scan |
| 56 | + uses: SonarSource/sonarcloud-github-action@master |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
| 59 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 60 | + with: |
| 61 | + args: > |
| 62 | + -Dsonar.externalIssuesReportPaths=sonar-issues.json |
| 63 | + -Dcommunity.rust.lcov.reportPaths=lcov.info |
| 64 | + # - name: Generate code coverage |
| 65 | + # run: | |
| 66 | + # cargo install tarpaulin |
| 67 | + # cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml |
| 68 | + # # Save coverage report in Coveralls |
| 69 | + # - name: |
| 70 | + # Coveralls |
| 71 | + # if: ${{ success() }} |
| 72 | + # uses: coverallsapp/github-action@master |
| 73 | + # with: |
| 74 | + # github-token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments