|
75 | 75 | name: coverity-logs-linux |
76 | 76 | path: build/cov-int |
77 | 77 | retention-days: 7 |
| 78 | + |
| 79 | + |
| 80 | + coverity-windows: |
| 81 | + runs-on: windows-latest |
| 82 | + |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v3 |
| 85 | + with: |
| 86 | + path: src |
| 87 | + - name: Setup MSVC |
| 88 | + uses: TheMrMilchmann/setup-msvc-dev@v2.0.0 |
| 89 | + with: |
| 90 | + arch: x64 |
| 91 | + - name: Configure |
| 92 | + run: | |
| 93 | + cmake -B build -S src -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_HIDTEST=ON |
| 94 | + - name: Get and configure Coverity |
| 95 | + run: | |
| 96 | + Invoke-WebRequest -Uri https://scan.coverity.com/download/cxx/win64 -OutFile coverity.zip -Method Post -Body @{token='${{ secrets.COVERITY_SCAN_TOKEN }}';project='hidapi'} |
| 97 | + Expand-Archive coverity.zip -DestinationPath cov-root |
| 98 | +
|
| 99 | + $cov_root=Get-ChildItem -Path 'cov-root' |
| 100 | + $Env:PATH += ";$($cov_root.FullName)\bin" |
| 101 | + cov-configure -msvc |
| 102 | +
|
| 103 | + echo "$($cov_root.FullName)\bin" >> $Env:GITHUB_PATH |
| 104 | + - name: Build with Coverity |
| 105 | + working-directory: build |
| 106 | + run: cov-build --dir cov-int nmake |
| 107 | + - name: Backup Coverity logs |
| 108 | + uses: actions/upload-artifact@v3 |
| 109 | + with: |
| 110 | + name: coverity-logs-windows |
| 111 | + path: build/cov-int |
| 112 | + retention-days: 7 |
| 113 | + - name: Submit results to Coverity Scan |
| 114 | + working-directory: build |
| 115 | + run: | |
| 116 | + tar -czf cov-int.tar.gz cov-int |
| 117 | + Invoke-RestMethod -Uri 'https://scan.coverity.com/builds?project=hidapi' ` |
| 118 | + -Method Post -Form @{ ` |
| 119 | + email='${{ secrets.COVERITY_SCAN_EMAIL }}'; ` |
| 120 | + token='${{ secrets.COVERITY_SCAN_TOKEN }}'; ` |
| 121 | + file=Get-Item 'cov-int.tar.gz'; ` |
| 122 | + version=$Env:GITHUB_SHA; ` |
| 123 | + description='Automatic Windows build' ` |
| 124 | + } |
0 commit comments