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
161 changes: 0 additions & 161 deletions .github/actions/test-and-report/action.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
submodules: recursive

- name: Set up Java
- name: Setup Java
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
Expand All @@ -59,7 +59,7 @@ jobs:
echo "packages=${packages} ndk;${ndk} cmake;${cmake}"
} >> "${GITHUB_OUTPUT}"

- name: Set up Android SDK
- name: Setup Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
with:
packages: ${{ steps.sdk.outputs.packages }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci-apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
required: true
type: boolean
secrets:
CODECOV_TOKEN:
required: false
APPLE_ID:
required: false
APPLE_TEAM_ID:
Expand Down Expand Up @@ -39,7 +37,6 @@ jobs:
with:
publish_release: ${{ inputs.publish_release }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_NOTARYTOOL_PASSWORD: ${{ secrets.APPLE_NOTARYTOOL_PASSWORD }}
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/ci-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: CI-Coverage
permissions: {}

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false

jobs:
upload:
name: ${{ matrix.platform }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
platform:
- Linux-aarch64
- Linux-x86_64
- macOS-arm64
- macOS-x86_64
- Windows-AMD64
- Windows-ARM64
- Xbox-guest-xemu-Linux
- Xbox-guest-xemu-macOS
- Xbox-guest-xemu-Windows
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Download test and coverage artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: Tests-${{ matrix.platform }}
path: _coverage

- name: Upload test coverage
if: hashFiles('_coverage/coverage.info') != ''
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
disable_search: true
fail_ci_if_error: true
files: _coverage/coverage.info
report_type: coverage
flags: ${{ matrix.platform }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results
if: ${{ !cancelled() && hashFiles('_coverage/test_results.xml') != '' }}
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
disable_search: true
fail_ci_if_error: true
files: _coverage/test_results.xml
report_type: test_results
flags: ${{ matrix.platform }}
token: ${{ secrets.CODECOV_TOKEN }}
69 changes: 54 additions & 15 deletions .github/workflows/ci-flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ permissions: {}

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false

jobs:
build:
Expand All @@ -17,7 +14,7 @@ jobs:
env:
FLATPAK_APP_ID: dev.lizardbyte.app.SunshineClient
FLATPAK_ARCH: ${{ matrix.arch }}
FLATPAK_MODULE_DIR: cmake-build-flatpak/.flatpak-builder/build/sunshine-client
FLATPAK_BUILD_DIR: cmake-build-flatpak/.flatpak-builder/build/sunshine-client/_flatpak_build
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -55,7 +52,6 @@ jobs:
"org.freedesktop.Sdk/${FLATPAK_ARCH}/${runtime_version}"

- name: Build Flatpak
id: flatpak
working-directory: cmake-build-flatpak
run: |
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
Expand All @@ -70,14 +66,57 @@ jobs:
name: Sunshine-client-Flatpak-${{ matrix.arch }}
path: Sunshine-client-*.flatpak

- name: Publish Flatpak test reports
if: >-
${{ !cancelled() &&
(steps.flatpak.outcome == 'success' ||
hashFiles(format('{0}/_flatpak_build/tests/test_results.xml', env.FLATPAK_MODULE_DIR)) != '') }}
uses: ./.github/actions/test-and-report
- name: Collect Flatpak test results
id: tests
if: ${{ !cancelled() && hashFiles(format('{0}/tests/test_results.xml', env.FLATPAK_BUILD_DIR)) != '' }}
run: cp "${FLATPAK_BUILD_DIR}/tests/test_results.xml" "${FLATPAK_BUILD_DIR}/test_results.xml"

- name: Setup Python
if: ${{ !cancelled() && steps.tests.outcome == 'success' }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.14'

- name: Setup uv
if: ${{ !cancelled() && steps.tests.outcome == 'success' }}
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
enable-cache: true
cache-dependency-glob: third-party/lizardbyte-common/uv.lock

- name: Generate Flatpak coverage report
if: ${{ !cancelled() && steps.tests.outcome == 'success' }}
run: |
set -euo pipefail
uv sync --project third-party/lizardbyte-common --locked --only-group test-c \
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
--no-build --no-python-downloads --no-install-project
report="${PWD}/${FLATPAK_BUILD_DIR}/coverage.info"
module_dir="$(realpath "${FLATPAK_BUILD_DIR}/..")"
# The sandbox already generated gcov files using its own toolchain.
uv run --directory "${module_dir}" --project "${PWD}/third-party/lizardbyte-common" \
--locked --no-sync gcovr "${PWD}/${FLATPAK_BUILD_DIR}" -r . --gcov-use-existing-files --filter src \
--exclude-noncode-lines --exclude-throw-branches --exclude-unreachable-branches --lcov "${report}.raw"
awk -v root="${module_dir}/" '
/^SF:/ {
source = substr($0, 4)
if (index(source, root) != 1) {
print "Coverage source is outside the source tree: " source > "/dev/stderr"
exit 1
}
$0 = "SF:" substr(source, length(root) + 1)
}
{ print }
' "${report}.raw" > "${report}.tmp"
grep -q '^SF:src/' "${report}.tmp"
mv "${report}.tmp" "${report}"

- name: Upload test and coverage artifacts
if: ${{ !cancelled() && steps.tests.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
build-dir: ${{ env.FLATPAK_MODULE_DIR }}/_flatpak_build
gcov-source-root: ${{ env.FLATPAK_MODULE_DIR }}
platform: Linux-${{ matrix.arch }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
name: Tests-Linux-${{ matrix.arch }}
path: |
${{ env.FLATPAK_BUILD_DIR }}/coverage.info
${{ env.FLATPAK_BUILD_DIR }}/test_results.xml
include-hidden-files: true
if-no-files-found: error
5 changes: 0 additions & 5 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ permissions: {}

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: false

jobs:
flatpak:
name: Flatpak
permissions:
contents: read
uses: ./.github/workflows/ci-flatpak.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading
Loading