|
68 | 68 | - name: Assert
|
69 | 69 | run: |
|
70 | 70 | ./test/assertFileContains ./output.properties "sonar.projectBaseDir=.*/baseDir"
|
| 71 | + scannerVersionTest: |
| 72 | + name: > |
| 73 | + 'scannerVersion' input |
| 74 | + runs-on: ubuntu-latest # assumes default RUNNER_ARCH for linux is X64 |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + with: |
| 78 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + - name: Run action with scannerVersion |
| 80 | + uses: ./ |
| 81 | + with: |
| 82 | + scannerVersion: 6.1.0.4477 |
| 83 | + args: -Dsonar.scanner.internal.dumpToFile=./output.properties |
| 84 | + env: |
| 85 | + NO_CACHE: true # force install-sonar-scanner-cli.sh execution |
| 86 | + SONAR_HOST_URL: http://not_actually_used |
| 87 | + SONAR_SCANNER_JSON_PARAMS: '{"sonar.scanner.internal.dumpToFile": "./output.properties"}' |
| 88 | + - name: Assert |
| 89 | + run: | |
| 90 | + ./test/assertFileExists "$RUNNER_TEMP/sonarscanner/sonar-scanner-cli-6.1.0.4477-linux-x64.zip" |
| 91 | + scannerBinariesUrlTest: |
| 92 | + name: > |
| 93 | + 'scannerBinariesUrl' input with invalid URL |
| 94 | + runs-on: ubuntu-latest # assumes default RUNNER_ARCH for linux is X64 |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v4 |
| 97 | + with: |
| 98 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + - name: Run action with scannerBinariesUrl |
| 100 | + id: runTest |
| 101 | + uses: ./ |
| 102 | + continue-on-error: true |
| 103 | + with: |
| 104 | + scannerVersion: 6.2.1.4610 |
| 105 | + scannerBinariesUrl: https://invalid_uri/Distribution/sonar-scanner-cli |
| 106 | + env: |
| 107 | + NO_CACHE: true # force install-sonar-scanner-cli.sh execution |
| 108 | + SONAR_HOST_URL: http://not_actually_used |
| 109 | + SONAR_SCANNER_JSON_PARAMS: '{"sonar.scanner.internal.dumpToFile": "./output.properties"}' |
| 110 | + - name: Fail if action succeeded |
| 111 | + if: steps.runTest.outcome == 'success' |
| 112 | + run: exit 1 |
| 113 | + - name: Assert Sonar Scanner CLI was not downloaded |
| 114 | + run: | |
| 115 | + ls . |
| 116 | + ./test/assertFileDoesntExist "$RUNNER_TEMP/sonarscanner/sonar-scanner-cli-6.2.1.4610-linux-x64.zip" |
| 117 | + - name: Assert Sonar Scanner CLI was not executed |
| 118 | + run: | |
| 119 | + ./test/assertFileDoesntExist ./output.properties |
71 | 120 | dontFailGradleTest:
|
72 | 121 | name: >
|
73 | 122 | Don't fail on Gradle project
|
|
0 commit comments