mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
0ece126cad
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
47 lines
1.8 KiB
YAML
47 lines
1.8 KiB
YAML
name: SonarCloud analysis
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
jobs:
|
|
build:
|
|
name: SonarCloud analysis
|
|
runs-on: ubuntu-22.04
|
|
container: ghcr.io/nextcloud/continuous-integration-client:client-5.15-14
|
|
env:
|
|
SONAR_SERVER_URL: "https://sonarcloud.io"
|
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
|
|
- name: Restore cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /cache
|
|
key: ${{ runner.os }}
|
|
|
|
- name: Run build-wrapper
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DBUILD_COVERAGE=ON -DOPENSSL_ROOT_DIR=/usr/local/lib64
|
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ninja
|
|
- name: Run tests
|
|
run: |
|
|
cd build
|
|
useradd -m -s /bin/bash test
|
|
chown -R test:test .
|
|
su -c 'xvfb-run ctest --output-on-failure --output-junit testResult.xml' test
|
|
- name: Generate coverage report
|
|
run: |
|
|
cd build
|
|
su -c 'ctest -T Coverage' test
|
|
- name: Run sonar-scanner
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
run: |
|
|
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 }}"
|