Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 2 additions & 54 deletions .github/workflows/ci-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Fix homebrew python
if: matrix.os_name == 'macos' && matrix.os_version == '13'
run: |
rm '/usr/local/bin/2to3'
rm '/usr/local/bin/2to3-3.12'
rm '/usr/local/bin/idle3'
rm '/usr/local/bin/idle3.12'
rm '/usr/local/bin/idle3.13'
rm '/usr/local/bin/pip3.12'
rm '/usr/local/bin/pip3.13'
rm '/usr/local/bin/pydoc3'
rm '/usr/local/bin/pydoc3.12'
rm '/usr/local/bin/pydoc3.13'
rm '/usr/local/bin/python3'
rm '/usr/local/bin/python3.12'
rm '/usr/local/bin/python3.13'
rm '/usr/local/bin/python3-config'
rm '/usr/local/bin/python3.12-config'
rm '/usr/local/bin/python3.13-config'
brew install python3

- name: Configure formula
env:
INPUT_RELEASE_VERSION: ${{ inputs.release_version }}
Expand Down Expand Up @@ -165,37 +144,6 @@ jobs:
validate: true
- run: echo "::remove-matcher owner=gcc-strip3::"

- name: Setup python
id: python
if: false
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Generate gcov report
id: test_report
# any except canceled or skipped
# TODO: fix coverage, no .gcno files are being created
# TODO: .gcno files are supposed to be created next to .o files
if: false
# if: >-
# always() &&
# matrix.release != true &&
# (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
run: |
cp -rf ${{ steps.test.outputs.buildpath }}/build/ ./build/
cd build
ls -Ra

${{ steps.python.outputs.python-path }} -m pip install gcovr
${{ steps.python.outputs.python-path }} -m gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--verbose \
--xml-pretty \
-o coverage.xml

- name: Upload coverage artifact
if: >-
always() &&
Expand All @@ -206,8 +154,8 @@ jobs:
with:
name: coverage-Homebrew-${{ matrix.os_name }}-${{ matrix.os_version }}
path: |
build/coverage.xml
${{ steps.test.outputs.testpath }}/test_results.xml
${{ steps.test.outputs.testpath }}/coverage.xml
${{ steps.test.outputs.testpath }}/tests/test_results.xml
if-no-files-found: error

- name: Patch homebrew formula
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
coverage: false
pr: true
- name: Homebrew-ubuntu-latest
coverage: false
coverage: true
pr: true
- name: Windows-AMD64
coverage: true
Expand Down Expand Up @@ -208,7 +208,9 @@ jobs:
verbose: true

- name: Upload coverage
if: steps.should_run.outputs.SHOULD_RUN == 'true' && matrix.coverage != false
if: |
steps.should_run.outputs.SHOULD_RUN == 'true' &&
matrix.coverage != false
uses: codecov/codecov-action@v5
with:
disable_search: true
Expand Down
44 changes: 42 additions & 2 deletions packaging/sunshine.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require "language/node"

class Sunshine < Formula
GCC_VERSION = "14".freeze
GCC_FORMULA = "gcc@#{GCC_VERSION}".freeze

# conflicts_with "sunshine", because: "sunshine and sunshine-beta cannot be installed at the same time"
desc "@PROJECT_DESCRIPTION@"
homepage "@PROJECT_HOMEPAGE_URL@"
Expand Down Expand Up @@ -31,14 +34,20 @@ class Sunshine < Formula
depends_on "graphviz" => :build
depends_on "node" => :build
depends_on "pkgconf" => :build
depends_on "gcovr" => :test
depends_on "curl"
depends_on "miniupnpc"
depends_on "openssl"
depends_on "opus"
depends_on "boost" => :recommended
depends_on "icu4c" => :recommended

on_macos do
depends_on "llvm" => [:build, :test]
end

on_linux do
depends_on GCC_FORMULA => [:build, :test]
depends_on "avahi"
depends_on "gnu-which"
depends_on "libayatana-appindicator"
Expand Down Expand Up @@ -76,6 +85,13 @@ def install
ENV["BUILD_VERSION"] = "@BUILD_VERSION@"
ENV["COMMIT"] = "@GITHUB_COMMIT@"

if OS.linux?
# Use GCC because gcov from llvm cannot handle our paths
gcc_path = Formula[GCC_FORMULA]
ENV["CC"] = "#{gcc_path.opt_bin}/gcc-#{GCC_VERSION}"
ENV["CXX"] = "#{gcc_path.opt_bin}/g++-#{GCC_VERSION}"
end

args = %W[
-DBUILD_WERROR=ON
-DCMAKE_CXX_STANDARD=23
Expand Down Expand Up @@ -169,7 +185,31 @@ def caveats
system bin/"sunshine", "--version"

# run the test suite
system bin/"test_sunshine", "--gtest_color=yes", "--gtest_output=xml:test_results.xml"
assert_path_exists testpath/"test_results.xml"
system bin/"test_sunshine", "--gtest_color=yes", "--gtest_output=xml:tests/test_results.xml"
assert_path_exists File.join(testpath, "tests", "test_results.xml")

# create gcovr report
buildpath = ENV.fetch("HOMEBREW_BUILDPATH", "")
unless buildpath.empty?
# Change to the source directory for gcovr to work properly
cd "#{buildpath}/build" do
# Use GCC version to match what was used during compilation
if OS.linux?
gcc_path = Formula[GCC_FORMULA]
gcov_executable = "#{gcc_path.opt_bin}/gcov-#{GCC_VERSION}"

system "gcovr", ".",
"-r", "../src",
"--gcov-executable", gcov_executable,
"--exclude-noncode-lines",
"--exclude-throw-branches",
"--exclude-unreachable-branches",
"--xml-pretty",
"-o=#{testpath}/coverage.xml"

assert_path_exists File.join(testpath, "coverage.xml")
end
end
end
end
end
Loading