Daily Tasks (#394) #106
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
# This runs SonarCloud to detect code issues. | |
name: SonarBuild | |
on: | |
pull_request: | |
branches: [ master ] | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
SONAR_SCANNER_VERSION: 4.6.1.2450 | |
SONAR_SERVER_URL: "https://sonarcloud.io" | |
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory | |
COVERAGE_RESULTS: coverage_results | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: vcpkg integrate install | |
- uses: ilammy/[email protected] | |
with: | |
arch: x86 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Download and set up build-wrapper | |
env: | |
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-win-x86.zip | |
run: | | |
if (!(Test-Path $HOME\.sonar\ -PathType Container)) { New-Item -ItemType Directory -Force -Path $HOME\.sonar\ } | |
curl -sSLo $HOME\.sonar\build-wrapper.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }} | |
unzip -o $HOME\.sonar\build-wrapper.zip -d $HOME\.sonar\ | |
echo "$HOME\.sonar\build-wrapper-win-x86" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 | |
- name: Run build-wrapper | |
run: | | |
build-wrapper-win-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} msbuild "${env:GITHUB_WORKSPACE}\project\FLHook.sln" /t:Build /p:Configuration=Release /p:Platform=Win32 | |
- name: Upload Sonar Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sonar-build | |
path: ${{ env.BUILD_WRAPPER_OUT_DIR }} | |
- name: Write PR Number | |
if: ${{ github.event_name == 'pull_request' }} | |
run: echo ${{ github.event.pull_request.number }} >> pr-number.txt | |
- name: Upload PR key | |
uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
name: pr-number | |
path: pr-number.txt |