Skip to content

Commit 1ad32e5

Browse files
Sightemadriweb
authored andcommitted
make CI 20x faster
1 parent 5ff2018 commit 1ad32e5

File tree

4 files changed

+157
-9
lines changed

4 files changed

+157
-9
lines changed

.github/workflows/build.linux.workflow.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
name: Build Linux
22

3+
permissions:
4+
contents: read
5+
packages: write
6+
37
on:
48
push:
59
branches: [ master, test-ci ]
610
pull_request:
711
branches: [ master ]
812

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
917
jobs:
1018
build:
1119
name: "Build: ${{ matrix.os }} - ${{ matrix.archvariant }}"
1220
runs-on: ${{ matrix.os }}
21+
env:
22+
VCPKG_FEATURE_FLAGS: manifests,binarycaching
23+
VCPKG_BINARY_SOURCES: ${{ format('clear;nuget,https://nuget.pkg.github.com/{0}/index.json,{1}', github.repository_owner, github.event_name == 'pull_request' && 'read' || 'readwrite') }}
24+
VCPKG_NUGET_REPOSITORY: https://github.com/${{ github.repository }}.git
25+
VCPKG_DOWNLOADS: ${{ github.workspace }}/.vcpkg-downloads
26+
SCCACHE_GHA_ENABLED: "true"
1327
strategy:
1428
fail-fast: false
1529
matrix:
@@ -44,27 +58,63 @@ jobs:
4458
- name: Install dependencies
4559
run: |
4660
set -e
47-
sudo apt update
48-
sudo apt install -y autoconf automake autoconf-archive '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev libudev-dev libusb-1.0-0-dev
61+
sudo apt-get update
62+
sudo apt-get install -y --no-install-recommends autoconf automake autoconf-archive mono-runtime '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev libudev-dev libusb-1.0-0-dev
4963
5064
- name: Install latest CMake
5165
uses: lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
5266

67+
- name: Ensure vcpkg downloads directory exists
68+
run: |
69+
mkdir -p "$VCPKG_DOWNLOADS"
70+
71+
- name: Cache vcpkg downloads
72+
uses: actions/cache@v4
73+
with:
74+
path: ${{ env.VCPKG_DOWNLOADS }}
75+
key: ${{ runner.os }}-vcpkg-downloads-${{ hashFiles('gui/qt/vcpkg.json', 'gui/qt/vcpkg-configuration.json') }}
76+
restore-keys: |
77+
${{ runner.os }}-vcpkg-downloads-
78+
5379
- name: Restore artifacts, or setup vcpkg (do not install any package)
5480
uses: lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
5581
with:
5682
vcpkgJsonGlob: '**/gui/qt/vcpkg.json'
5783

84+
- name: Configure vcpkg NuGet source
85+
shell: bash
86+
run: |
87+
set -euo pipefail
88+
NUGET_PATH="$(${VCPKG_ROOT}/vcpkg fetch nuget | tail -n 1 | tr -d '\r')"
89+
echo "Resolved NuGet at: $NUGET_PATH"
90+
if [[ "$NUGET_PATH" == *.exe ]]; then
91+
NUGET_CMD=(mono "$NUGET_PATH")
92+
else
93+
NUGET_CMD=("$NUGET_PATH")
94+
fi
95+
96+
"${NUGET_CMD[@]}" sources remove -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" || true
97+
"${NUGET_CMD[@]}" sources add -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
98+
-Username "${{ github.repository_owner }}" \
99+
-Password "${{ secrets.GITHUB_TOKEN }}" \
100+
-StorePasswordInClearText
101+
102+
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
103+
"${NUGET_CMD[@]}" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
104+
fi
105+
106+
- name: Start sccache
107+
uses: mozilla-actions/[email protected]
108+
58109
- name: Build CEmu ${{ matrix.archvariant }} ${{ matrix.config }} on Linux ${{ matrix.arch }}
59110
uses: lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
60111
with:
61112
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
62113
configurePreset: 'Linux-${{ matrix.archvariant }}'
63-
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0']"
114+
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
64115
buildPreset: 'Linux-${{ matrix.archvariant }}-${{ matrix.config }}'
65116
env:
66117
VCPKG_DEFAULT_HOST_TRIPLET: ${{ matrix.arch }}-linux-${{ matrix.host_triplet }}
67-
VCPKG_FORCE_SYSTEM_BINARIES: 1
68118

69119
- name: Upload binary as artifact
70120
uses: actions/upload-artifact@v4

.github/workflows/build.mac.workflow.yml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
name: Build macOS
22

3+
permissions:
4+
contents: read
5+
packages: write
6+
37
on:
48
push:
59
branches: [ master, test-ci ]
610
pull_request:
711
branches: [ master ]
812

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
917
jobs:
1018
build:
1119
name: "Build: ${{ matrix.archname }}"
1220
runs-on: macos-14
21+
env:
22+
VCPKG_FEATURE_FLAGS: manifests,binarycaching
23+
VCPKG_BINARY_SOURCES: ${{ format('clear;nuget,https://nuget.pkg.github.com/{0}/index.json,{1}', github.repository_owner, github.event_name == 'pull_request' && 'read' || 'readwrite') }}
24+
VCPKG_NUGET_REPOSITORY: https://github.com/${{ github.repository }}.git
25+
VCPKG_DOWNLOADS: ${{ github.workspace }}/.vcpkg-downloads
26+
VCPKG_FORCE_DOWNLOADED_BINARIES: "1"
27+
SCCACHE_GHA_ENABLED: "true"
28+
HOMEBREW_NO_AUTO_UPDATE: "1"
29+
HOMEBREW_NO_INSTALL_CLEANUP: "1"
1330
strategy:
1431
fail-fast: false
1532
matrix:
@@ -34,26 +51,69 @@ jobs:
3451
- name: Install dependencies
3552
run: |
3653
set -e
37-
brew install automake autoconf autoconf-archive libtool
54+
brew install automake autoconf autoconf-archive libtool mono
3855
3956
- name: Install latest CMake
4057
uses: lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
4158

59+
- name: Ensure vcpkg downloads directory exists
60+
run: |
61+
mkdir -p "$VCPKG_DOWNLOADS"
62+
63+
- name: Cache vcpkg downloads
64+
uses: actions/cache@v4
65+
with:
66+
path: ${{ env.VCPKG_DOWNLOADS }}
67+
key: ${{ runner.os }}-vcpkg-downloads-${{ hashFiles('gui/qt/vcpkg.json', 'gui/qt/vcpkg-configuration.json') }}
68+
restore-keys: |
69+
${{ runner.os }}-vcpkg-downloads-
70+
4271
- name: Restore artifacts, or setup vcpkg (do not install any package)
4372
uses: lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
4473
with:
4574
vcpkgJsonGlob: '**/gui/qt/vcpkg.json'
4675

76+
- name: Download nuget.exe and export to env
77+
shell: bash
78+
run: |
79+
set -euo pipefail
80+
curl -sSL -o "$RUNNER_TEMP/nuget.exe" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
81+
echo "NUGET=$RUNNER_TEMP/nuget.exe" >> "$GITHUB_ENV"
82+
83+
- name: Provide working 'nuget' on PATH
84+
shell: bash
85+
run: |
86+
set -euo pipefail
87+
printf '#!/usr/bin/env bash\nexec mono "$NUGET" "$@"\n' > "$RUNNER_TEMP/nuget"
88+
chmod +x "$RUNNER_TEMP/nuget"
89+
echo "PATH=$RUNNER_TEMP:$PATH" >> "$GITHUB_ENV"
90+
91+
- name: Configure vcpkg NuGet source
92+
shell: bash
93+
run: |
94+
set -euo pipefail
95+
mono "$NUGET" sources remove -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" || true
96+
mono "$NUGET" sources add -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
97+
-Username "${{ github.repository_owner }}" \
98+
-Password "${{ secrets.GITHUB_TOKEN }}" \
99+
-StorePasswordInClearText
100+
101+
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
102+
mono "$NUGET" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
103+
fi
104+
105+
- name: Start sccache
106+
uses: mozilla-actions/[email protected]
107+
47108
- name: Build CEmu ${{ matrix.config }} on macOS ${{ matrix.arch }}
48109
uses: lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
49110
with:
50111
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
51112
configurePreset: 'Mac-${{ matrix.arch }}'
52-
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0']"
113+
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
53114
buildPreset: 'Mac-${{ matrix.arch }}-${{ matrix.config }}'
54115
env:
55116
VCPKG_DEFAULT_HOST_TRIPLET: arm64-osx-release
56-
VCPKG_FORCE_SYSTEM_BINARIES: 1
57117

58118
- name: Move to temp folder
59119
run: |

.github/workflows/build.windows.workflow.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
name: Build Windows
22

3+
permissions:
4+
contents: read
5+
packages: write
6+
37
on:
48
push:
59
branches: [ master, test-ci ]
610
pull_request:
711
branches: [ master ]
812

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
917
jobs:
1018
build:
1119
name: "Build: Windows ${{ matrix.arch }}-${{ matrix.config }}"
1220
runs-on: windows-latest
21+
env:
22+
VCPKG_FEATURE_FLAGS: manifests,binarycaching
23+
VCPKG_BINARY_SOURCES: ${{ format('clear;nuget,https://nuget.pkg.github.com/{0}/index.json,{1}', github.repository_owner, github.event_name == 'pull_request' && 'read' || 'readwrite') }}
24+
VCPKG_NUGET_REPOSITORY: https://github.com/${{ github.repository }}.git
25+
VCPKG_DOWNLOADS: ${{ github.workspace }}\.vcpkg-downloads
26+
SCCACHE_GHA_ENABLED: "true"
1327

1428
strategy:
1529
fail-fast: false
@@ -34,17 +48,41 @@ jobs:
3448
- name: Install latest CMake
3549
uses: lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
3650

51+
- name: Ensure vcpkg downloads directory exists
52+
shell: pwsh
53+
run: |
54+
New-Item -ItemType Directory -Path "$env:VCPKG_DOWNLOADS" -Force | Out-Null
55+
56+
- name: Cache vcpkg downloads
57+
uses: actions/cache@v4
58+
with:
59+
path: ${{ env.VCPKG_DOWNLOADS }}
60+
key: ${{ runner.os }}-vcpkg-downloads-${{ hashFiles('gui/qt/vcpkg.json', 'gui/qt/vcpkg-configuration.json') }}
61+
restore-keys: |
62+
${{ runner.os }}-vcpkg-downloads-
63+
3764
- name: Restore artifacts, or setup vcpkg (do not install any package)
3865
uses: lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
3966
with:
4067
vcpkgJsonGlob: '**/gui/qt/vcpkg.json'
4168

69+
- name: Configure vcpkg NuGet source
70+
shell: pwsh
71+
run: |
72+
$nugetExe = (& "$env:VCPKG_ROOT\vcpkg.exe" fetch nuget | Select-Object -Last 1)
73+
& $nugetExe sources remove -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" 2>$null
74+
& $nugetExe sources add -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" -Username "${{ github.repository_owner }}" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
75+
& $nugetExe setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
76+
77+
- name: Start sccache
78+
uses: mozilla-actions/[email protected]
79+
4280
- name: Build CEmu ${{ matrix.config }} on Windows ${{ matrix.arch_name }}
4381
uses: lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
4482
with:
4583
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
4684
configurePreset: 'Win-${{ matrix.arch }}'
47-
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0']"
85+
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
4886
buildPreset: 'Win-${{ matrix.arch }}-${{ matrix.config }}'
4987
env:
5088
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-windows

.github/workflows/coverity.workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
set -e
2020
sudo apt-get update
21-
sudo apt-get install qt6-base-dev qmake6 qtchooser libgl1-mesa-dev libarchive-dev libudev-dev libusb-1.0-0-dev
21+
sudo apt-get install -y --no-install-recommends qt6-base-dev qmake6 qtchooser libgl1-mesa-dev libarchive-dev libudev-dev libusb-1.0-0-dev
2222
2323
- name: set-up qt6
2424
run: |

0 commit comments

Comments
 (0)