Skip to content

Commit

Permalink
Fix review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Jun 10, 2022
1 parent 21a1ebd commit d5bba4c
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 81 deletions.
83 changes: 2 additions & 81 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test
name: SonarCloud analysis
on:
push:
branches:
Expand All @@ -7,7 +7,7 @@ on:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build-Linux
name: Build
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client:client-5.15-4
env:
Expand Down Expand Up @@ -48,82 +48,3 @@ jobs:
cp sonar-project.properties build
cd build
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
build-on-windows:
name: Build-Windows
runs-on: windows-2019
env:
CRAFT_TARGET: windows-msvc2019_64-cl
COBERTURA_COVERAGE_FILE: ${{ github.workspace }}\cobertura_coverage\coverage.xml
CRAFT_MASTER_LOCATION: ${{ github.workspace }}\CraftMaster
CRAFT_MASTER_CONFIG: ${{ github.workspace }}\craftmaster.ini
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install Craft Master with Nextcloud Client Deps
shell: pwsh
run: |
& cmd /C "git clone -q --depth=1 https://invent.kde.org/packaging/craftmaster.git ${{ env.CRAFT_MASTER_LOCATION }} 2>&1"
function craft() {
python "${{ env.CRAFT_MASTER_LOCATION }}\CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c $args
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}
craft --add-blueprint-repository [git]https://github.com/nextcloud/desktop-client-blueprints.git
craft craft
craft --install-deps nextcloud-client
craft nsis
- name: Cache Install OpenCppCoverage
id: cache-install-opencppcoverage
uses: actions/cache@v3
with:
path: C:\Program Files\OpenCppCoverage
key: ${{ runner.os }}-cache-install-opencppcoverage

- name: Install OpenCppCoverage
if: steps.cache-install-opencppcoverage.outputs.cache-hit != 'true'
shell: pwsh
run: |
choco install opencppcoverage
- name: Setup PATH
shell: pwsh
run: |
echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}\${{ env.CRAFT_TARGET }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Compile
shell: pwsh
run: |
function craft() {
python "${{ env.CRAFT_MASTER_LOCATION }}\CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c $args
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}
craft --src-dir ${{ github.workspace }} nextcloud-client
- name: Run tests
shell: pwsh
run: |
function runTestsAndCreateCoverage() {
$buildFolder = "${{ github.workspace }}\${{ env.CRAFT_TARGET }}\build\nextcloud-client\work\build"
cd $buildFolder
$binFolder = "$buildFolder\bin"
& OpenCppCoverage.exe --quiet --sources ${{ github.workspace }} --modules $binFolder\*.dll* --export_type cobertura:${{ env.COBERTURA_COVERAGE_FILE }} --cover_children -- ctest --output-on-failure --timeout 300 -j (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
}
runTestsAndCreateCoverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ github.workspace }}\cobertura_coverage
fail_ci_if_error: true
85 changes: 85 additions & 0 deletions .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build and Test
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: windows-2019
env:
CRAFT_TARGET: windows-msvc2019_64-cl
COBERTURA_COVERAGE_FILE: ${{ github.workspace }}\cobertura_coverage\coverage.xml
CRAFT_MASTER_LOCATION: ${{ github.workspace }}\CraftMaster
CRAFT_MASTER_CONFIG: ${{ github.workspace }}\craftmaster.ini
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install Craft Master with Nextcloud Client Deps
shell: pwsh
run: |
& cmd /C "git clone -q --depth=1 https://invent.kde.org/packaging/craftmaster.git ${{ env.CRAFT_MASTER_LOCATION }} 2>&1"
function craft() {
python "${{ env.CRAFT_MASTER_LOCATION }}\CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c $args
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}
craft --add-blueprint-repository [git]https://github.com/nextcloud/desktop-client-blueprints.git
craft craft
craft --install-deps nextcloud-client
- name: Cache Install OpenCppCoverage
id: cache-install-opencppcoverage
uses: actions/cache@v3
with:
path: C:\Program Files\OpenCppCoverage
key: ${{ runner.os }}-cache-install-opencppcoverage

- name: Install OpenCppCoverage
if: steps.cache-install-opencppcoverage.outputs.cache-hit != 'true'
shell: pwsh
run: |
choco install opencppcoverage
- name: Setup PATH
shell: pwsh
run: |
echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}\${{ env.CRAFT_TARGET }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Compile
shell: pwsh
run: |
function craft() {
python "${{ env.CRAFT_MASTER_LOCATION }}\CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c $args
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}
craft --src-dir ${{ github.workspace }} nextcloud-client
- name: Run tests
shell: pwsh
run: |
function runTestsAndCreateCoverage() {
$buildFolder = "${{ github.workspace }}\${{ env.CRAFT_TARGET }}\build\nextcloud-client\work\build"
cd $buildFolder
$binFolder = "$buildFolder\bin"
& OpenCppCoverage.exe --quiet --sources ${{ github.workspace }} --modules $binFolder\*.dll* --export_type cobertura:${{ env.COBERTURA_COVERAGE_FILE }} --cover_children -- ctest --output-on-failure --timeout 300 -j (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
}
runTestsAndCreateCoverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ github.workspace }}\cobertura_coverage
fail_ci_if_error: true

0 comments on commit d5bba4c

Please sign in to comment.