Skip to content

Commit

Permalink
Merge pull request #2388 from LizardByte/nightly
Browse files Browse the repository at this point in the history
v0.23.1
  • Loading branch information
ReenigneArcher committed Apr 21, 2024
2 parents 14ed89d + 067efc7 commit 8b21db6
Show file tree
Hide file tree
Showing 67 changed files with 1,213 additions and 352 deletions.
10 changes: 10 additions & 0 deletions .codeql-prebuild-cpp.sh → .codeql-prebuild-cpp-Linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# install dependencies for C++ analysis
set -e

sudo apt-get update -y
sudo apt-get install -y \
Expand Down Expand Up @@ -54,3 +55,12 @@ sudo wget \
sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm
sudo rm /root/cuda.run

# build
mkdir -p build
cd build || exit 1
cmake -G "Unix Makefiles" ..
make -j"$(nproc)"

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
34 changes: 34 additions & 0 deletions .codeql-prebuild-cpp-Windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# install dependencies for C++ analysis
set -e

# update pacman
pacman --noconfirm -Suy

# install dependencies
pacman --noconfirm -S \
base-devel \
diffutils \
gcc \
git \
make \
mingw-w64-x86_64-binutils \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-curl \
mingw-w64-x86_64-miniupnpc \
mingw-w64-x86_64-nlohmann-json \
mingw-w64-x86_64-nodejs \
mingw-w64-x86_64-onevpl \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-opus \
mingw-w64-x86_64-rust \
mingw-w64-x86_64-toolchain

# build
mkdir -p build
cd build || exit 1
cmake -G "MinGW Makefiles" ..
mingw32-make -j"$(nproc)"

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
20 changes: 20 additions & 0 deletions .codeql-prebuild-cpp-macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# install dependencies for C++ analysis
set -e

# install dependencies
brew install \
boost \
cmake \
miniupnpc \
node \
opus \
pkg-config

# build
mkdir -p build
cd build || exit 1
cmake -G "Unix Makefiles" ..
make -j"$(sysctl -n hw.logicalcpu)"

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
59 changes: 44 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ jobs:
then
echo "This is a PUSH event"
branch=${{ github.ref_name }}
build_version=${{ needs.check_changelog.outputs.next_version }}
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}
else
Expand All @@ -227,6 +228,7 @@ jobs:
cd build
cmake -DGITHUB_CLONE_URL=${clone_url} \
-DBUILD_VERSION=${build_version} \
-DGITHUB_BRANCH=${branch} \
-DGITHUB_COMMIT=${commit} \
-DSUNSHINE_CONFIGURE_FLATPAK_MAN=ON \
Expand Down Expand Up @@ -377,7 +379,7 @@ jobs:
- name: Build Linux
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }}
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
timeout-minutes: 5
run: |
Expand Down Expand Up @@ -500,18 +502,24 @@ jobs:
run: |
${{ steps.python.outputs.python-path }} -m pip install gcovr
${{ steps.python.outputs.python-path }} -m gcovr -r .. \
--exclude ../tests/ \
--exclude ../third-party/ \
--exclude '.*tests/.*' \
--exclude '.*tests/.*' \
--xml-pretty \
-o coverage.xml
- name: Upload coverage
# any except canceled or skipped
if: always() && (steps.test_report.outcome == 'success')
uses: codecov/codecov-action@v3
if: >-
always() &&
(steps.test_report.outcome == 'success') &&
startsWith(github.repository, 'LizardByte/')
uses: codecov/codecov-action@v4
with:
disable_search: true
fail_ci_if_error: true
files: ./build/coverage.xml
flags: ${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
Expand Down Expand Up @@ -560,13 +568,16 @@ jobs:
if [ -z "$branch" ]
then
echo "This is a PUSH event"
build_version=${{ needs.check_changelog.outputs.next_version }}
clone_url=${{ github.event.repository.clone_url }}
branch="${{ github.ref_name }}"
commit=${{ github.sha }}
default_branch="${{ github.event.repository.default_branch }}"
else
echo "This is a PR event"
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
branch="${{ github.event.pull_request.head.ref }}"
commit=${{ github.event.pull_request.head.sha }}
default_branch="${{ github.event.pull_request.head.repo.default_branch }}"
fi
echo "Branch: ${branch}"
Expand All @@ -575,7 +586,9 @@ jobs:
mkdir build
cd build
cmake \
-DBUILD_VERSION="${build_version}" \
-DGITHUB_BRANCH="${branch}" \
-DGITHUB_COMMIT="${commit}" \
-DGITHUB_CLONE_URL="${clone_url}" \
-DGITHUB_DEFAULT_BRANCH="${default_branch}" \
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
Expand Down Expand Up @@ -613,7 +626,7 @@ jobs:
echo "publish=${PUBLISH}" >> $GITHUB_OUTPUT
- name: Validate and Publish Homebrew Formula
uses: LizardByte/homebrew-release-action@v2024.314.134529
uses: LizardByte/homebrew-release-action@v2024.417.220943
with:
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
git_email: ${{ secrets.GH_BOT_EMAIL }}
Expand Down Expand Up @@ -673,6 +686,8 @@ jobs:
if [ -z "$branch" ]
then
echo "This is a PUSH event"
branch="${{ github.ref_name }}"
build_version=${{ needs.check_changelog.outputs.next_version }}
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}
else
Expand All @@ -686,6 +701,8 @@ jobs:
mkdir build
cd build
cmake \
-DBUILD_VERSION=${build_version} \
-DGITHUB_BRANCH=${branch} \
-DGITHUB_COMMIT=${commit} \
-DGITHUB_CLONE_URL=${clone_url} \
-DSUNSHINE_CONFIGURE_PORTFILE=ON \
Expand Down Expand Up @@ -821,20 +838,26 @@ jobs:
cd ${build_dir}
${{ steps.python.outputs.python-path }} -m pip install gcovr
sudo ${{ steps.python.outputs.python-path }} -m gcovr -r ../${dir} \
--exclude ../${dir}/tests/ \
--exclude ../${dir}/third-party/ \
--exclude '.*${dir}/tests/.*' \
--exclude '.*${dir}/third-party/.*' \
--gcov-object-directory $(pwd) \
--verbose \
--xml-pretty \
-o ${{ github.workspace }}/build/coverage.xml
- name: Upload coverage
# any except canceled or skipped
if: always() && (steps.test_report.outcome == 'success')
uses: codecov/codecov-action@v3
if: >-
always() &&
(steps.test_report.outcome == 'success') &&
startsWith(github.repository, 'LizardByte/')
uses: codecov/codecov-action@v4
with:
disable_search: true
fail_ci_if_error: false # todo: re-enable this when action is fixed
files: ./build/coverage.xml
flags: ${{ runner.os }}-${{ matrix.os_version }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' && matrix.release }}
Expand Down Expand Up @@ -1014,7 +1037,7 @@ jobs:
shell: msys2 {0}
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }}
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
mkdir build
Expand Down Expand Up @@ -1059,18 +1082,24 @@ jobs:
run: |
${{ steps.python-path.outputs.python-path }} -m pip install gcovr
${{ steps.python-path.outputs.python-path }} -m gcovr -r .. \
--exclude ../tests/ \
--exclude ../third-party/ \
--exclude '.*tests/.*' \
--exclude '.*tests/.*' \
--xml-pretty \
-o coverage.xml
- name: Upload coverage
# any except canceled or skipped
if: always() && (steps.test_report.outcome == 'success')
uses: codecov/codecov-action@v3
if: >-
always() &&
(steps.test_report.outcome == 'success') &&
startsWith(github.repository, 'LizardByte/')
uses: codecov/codecov-action@v4
with:
disable_search: true
fail_ci_if_error: true
files: ./build/coverage.xml
flags: ${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: Package Windows Debug Info
working-directory: build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Autoapproving
uses: hmarr/auto-approve-action@v3
uses: hmarr/auto-approve-action@v4
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand All @@ -49,7 +49,7 @@ jobs:

steps:
- name: Automerging
uses: pascalgn/automerge-action@v0.15.6
uses: pascalgn/automerge-action@v0.16.3
env:
BASE_BRANCHES: nightly
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
Expand Down
51 changes: 41 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -57,10 +57,25 @@ jobs:
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`)
key = remap_languages[key.toLowerCase()]
}
if (supported_languages.includes(key.toLowerCase()) &&
!matrix['include'].includes({"language": key.toLowerCase()})) {
if (supported_languages.includes(key.toLowerCase())) {
console.log(`Found supported language: ${key}`)
matrix['include'].push({"language": key.toLowerCase()})
let osList = ['ubuntu-latest'];
if (key.toLowerCase() === 'swift') {
osList = ['macos-latest'];
} else if (key.toLowerCase() === 'cpp') {
osList = ['macos-latest', 'ubuntu-latest', 'windows-latest'];
}
for (let os of osList) {
// set name for matrix
if (osList.length == 1) {
name = key.toLowerCase()
} else {
name = `${key.toLowerCase()}, ${os}`
}
// add to matrix
matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name})
}
}
}
Expand All @@ -84,10 +99,15 @@ jobs:
}
analyze:
name: Analyze
name: Analyze (${{ matrix.name }})
if: ${{ needs.languages.outputs.continue == 'true' }}
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
env:
GITHUB_CODEQL_BUILD: true
needs: [languages]
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand All @@ -100,6 +120,7 @@ jobs:

steps:
- name: Maximize build space
if: runner.os == 'Linux'
uses: easimon/maximize-build-space@v8
with:
root-reserve-mb: 20480
Expand All @@ -114,6 +135,12 @@ jobs:
with:
submodules: recursive

- name: Setup msys2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
update: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand All @@ -129,16 +156,20 @@ jobs:

# Pre autobuild
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
# create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository
- name: Prebuild
id: prebuild
run: |
# check if .qodeql-prebuild-${{ matrix.language }}.sh exists
if [ -f "./.codeql-prebuild-${{ matrix.language }}.sh" ]; then
echo "Running .codeql-prebuild-${{ matrix.language }}.sh"
./.codeql-prebuild-${{ matrix.language }}.sh
# check if prebuild script exists
filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh"
if [ -f "./${filename}" ]; then
echo "Running prebuild script: ${filename}"
./${filename}
fi
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
- name: Autobuild
if: steps.prebuild.outputs.skip_autobuild != 'true'
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cpp-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Clang format lint
if: ${{ steps.find_files.outputs.found_files }}
uses: DoozyX/clang-format-lint-action@v0.16.2
uses: DoozyX/clang-format-lint-action@v0.17
with:
source: ${{ steps.find_files.outputs.found_files }}
extensions: 'cpp,h,m,mm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
(github.event_name == 'workflow_dispatch')
uses: actions-js/push@v1.4
uses: actions-js/push@v1.5
with:
github_token: ${{ secrets.GH_BOT_TOKEN }}
author_email: ${{ secrets.GH_BOT_EMAIL }}
Expand Down
Loading

0 comments on commit 8b21db6

Please sign in to comment.