Fix trace mode on arm64 #1292
Workflow file for this run
This file contains hidden or 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
| --- | |
| name: "Report Coverage" | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Cleanup /usr/local | |
| run: | | |
| sudo mkdir /opt/local.old | |
| sudo mv /usr/local/* /opt/local.old | |
| # - name: Select Xcode version | |
| # run: | | |
| # sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer | |
| - name: Configure MacPorts Base | |
| run: | | |
| set -eu | |
| ./configure CFLAGS="-fprofile-instr-generate -fcoverage-mapping" LDFLAGS="-fprofile-instr-generate" | |
| - name: Build MacPorts Base | |
| run: | | |
| set -eu | |
| make -j$(sysctl -n hw.activecpu) | |
| - name: Test MacPorts Base | |
| run: | | |
| set -eu | |
| LLVM_PROFILE_FILE="$PWD/cov-%p.profraw" make test | |
| - name: Install MacPorts Base | |
| run: | | |
| set -eu | |
| sudo make install | |
| - name: Report Coverage | |
| run: | | |
| set -eu | |
| xcrun llvm-profdata merge --sparse --output=cov.profdata cov-*.profraw | |
| # tracelib cannot be profiled | |
| OBJ_FILES="$(find src -type f "(" -name "*.dylib" -o -name "*.a" ")" | grep -Fv darwintracelib1.0 | sed 's/^/--arch=arm64 --object=/')" | |
| xcrun llvm-cov show --format=html --output-dir=covreport --ignore-filename-regex=vendor/ --instr-profile=cov.profdata $OBJ_FILES | |
| xcrun llvm-cov report --ignore-filename-regex=vendor/ --instr-profile=cov.profdata $OBJ_FILES | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: code-coverage-report | |
| path: covreport/ |