Skip to content

update sonar workflow #31

update sonar workflow

update sonar workflow #31

Workflow file for this run

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
name: Build
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: Build & Test
runs-on: macos-26
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@main
- name: Install dependencies
run: bash ./.github/workflows/scripts/brew.sh
- name: Build C++ Libraries
run: bash ./scripts/build_dep.sh
- name: Select Xcode version
run: sudo xcode-select -switch /Applications/Xcode.app
- name: Run tests
run: >
OTHER_CFLAGS="-fprofile-instr-generate -fcoverage-mapping"
OTHER_CPLUSPLUSFLAGS="-fprofile-instr-generate -fcoverage-mapping"
OTHER_SWIFT_FLAGS="-profile-generate -profile-coverage-mapping"
LLVM_PROFILE_FILE="/tmp/coverage.profraw"
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
xcodebuild
-scheme tests
-destination 'platform=macOS,arch=arm64'
-resultBundlePath TestResult/
-enableCodeCoverage YES
-derivedDataPath "${RUNNER_TEMP}/Build/DerivedData"
-parallelizeTargets
-jobs "$(sysctl -n hw.logicalcpu)"
clean build test
| xcpretty -r junit && exit ${PIPESTATUS[0]}
- name: Convert coverage report to sonarqube format
run: >
bash ./.github/workflows/scripts/xccov-to-sonarqube-generic.sh *.xcresult/ > sonarqube-generic-coverage.xml
- name: Upload coverage report
uses: actions/upload-artifact@v7
with:
name: sonarqube-coverage
path: sonarqube-generic-coverage.xml
retention-days: 1