mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
gcovr report directly in homebrew tests
This commit is contained in:
44
.github/workflows/CI.yml
vendored
44
.github/workflows/CI.yml
vendored
@@ -535,12 +535,6 @@ jobs:
|
||||
rm '/usr/local/bin/python3.13-config'
|
||||
brew install python
|
||||
|
||||
- name: Setup python
|
||||
id: python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Configure formula
|
||||
run: |
|
||||
# variables for formula
|
||||
@@ -621,7 +615,7 @@ jobs:
|
||||
- name: Validate Homebrew Formula
|
||||
id: test
|
||||
if: matrix.release != true
|
||||
uses: LizardByte/homebrew-release-action@v2025.503.165455
|
||||
uses: LizardByte/homebrew-release-action@v2025.506.15440
|
||||
with:
|
||||
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
||||
git_email: ${{ secrets.GH_BOT_EMAIL }}
|
||||
@@ -630,26 +624,26 @@ jobs:
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
validate: true
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
# any except canceled or skipped
|
||||
if: >-
|
||||
always() &&
|
||||
matrix.release != true &&
|
||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
working-directory: ${{ steps.test.outputs.buildpath }}
|
||||
- name: Debug upload gcda artifact
|
||||
if: always() && matrix.release != true
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: homebrew-gcda-${{ matrix.os_name }}-${{ matrix.os_version }}
|
||||
path: ${{ steps.test.outputs.buildpath }}/build/tests/CMakeFiles/test_sunshine.dir/__/src/audio.cpp.gcda
|
||||
|
||||
- name: Debug homebrew buildpath
|
||||
if: always() && matrix.release != true
|
||||
run: |
|
||||
# print the build path
|
||||
echo "Build path: ${{ steps.test.outputs.buildpath }}"
|
||||
echo "contents:"
|
||||
ls -Ra
|
||||
|
||||
${{ steps.python.outputs.python-path }} -m pip install gcovr
|
||||
${{ steps.python.outputs.python-path }} -m gcovr \
|
||||
--exclude-noncode-lines \
|
||||
--exclude-throw-branches \
|
||||
--exclude-unreachable-branches \
|
||||
--filter src/ \
|
||||
--verbose \
|
||||
--xml-pretty \
|
||||
-o ${{ github.workspace }}/build/coverage.xml
|
||||
# print the test path
|
||||
echo "----"
|
||||
echo "Test path: ${{ steps.test.outputs.testpath }}"
|
||||
echo "contents:"
|
||||
ls -Ra
|
||||
|
||||
- name: Upload test results to Codecov
|
||||
# any except canceled or skipped
|
||||
@@ -679,7 +673,7 @@ jobs:
|
||||
with:
|
||||
disable_search: true
|
||||
fail_ci_if_error: true
|
||||
files: ./build/coverage.xml
|
||||
files: ${{ steps.test.outputs.testpath }}/build/coverage.xml
|
||||
flags: ${{ matrix.os_name }}-${{ matrix.os_version }} (Homebrew)
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
|
||||
@@ -32,6 +32,7 @@ class @PROJECT_NAME@ < Formula
|
||||
depends_on "ninja" => :build
|
||||
depends_on "node" => :build
|
||||
depends_on "pkg-config" => :build
|
||||
depends_on "gcovr" => :test
|
||||
depends_on "curl"
|
||||
depends_on "miniupnpc"
|
||||
depends_on "openssl"
|
||||
@@ -353,5 +354,21 @@ index 5b3638d..aca9481 100644
|
||||
# run the test suite
|
||||
system bin/"test_sunshine", "--gtest_color=yes", "--gtest_output=xml:test_results.xml"
|
||||
assert_path_exists testpath/"test_results.xml"
|
||||
|
||||
# create gcovr report
|
||||
if ENV["HOMEBREW_BUILDPATH"]
|
||||
|
||||
cd File.join(ENV["HOMEBREW_BUILDPATH"], "build") do
|
||||
system "gcovr", ".",
|
||||
"-r", "../src",
|
||||
"--exclude-noncode-lines",
|
||||
"--exclude-throw-branches",
|
||||
"--exclude-unreachable-branches",
|
||||
"--verbose",
|
||||
"--xml-pretty",
|
||||
"-o=coverage.xml"
|
||||
end
|
||||
assert_path_exists File.join(ENV["HOMEBREW_BUILDPATH"], "build", "coverage.xml")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user