Skip to content

Commit d91f94c

Browse files
committed
Merge branch 'main' into feature/hyperv-api-backend-virtual-machine
2 parents 993ae3b + f288ecd commit d91f94c

325 files changed

Lines changed: 13043 additions & 1989 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cli-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
has_targets: ${{ steps.neo.outputs.has_targets }}
5353
steps:
5454
- id: neo
55-
uses: actions/github-script@v8
55+
uses: actions/github-script@v9
5656
with:
5757
script: |
5858
const crypto = require('crypto');

.github/workflows/close-inactive-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
days-before-issue-stale: 30
1616
days-before-issue-close: 14
1717
stale-issue-label: "stale"
18-
stale-issue-message: "This issue was marked stale because it has been labelled with \"question\" for 30 days."
18+
stale-issue-message: "This issue was marked stale because it has been labelled with \"needs-info\" for 30 days."
1919
close-issue-message: "This issue was closed because it has been 14 days since being marked as stale."
2020

2121
# Leave PRs alone

.github/workflows/dynamic-ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
- 'docs/**'
4646
code:
4747
- ".github/workflows/linux*"
48-
- ".github/workflows/windows-macos.yml"
48+
- ".github/workflows/macos.yml"
49+
- ".github/workflows/windows.yml"
4950
- ".github/.codecov.yml"
5051
- "3rd-party/**"
5152
- "completions/**"
@@ -83,11 +84,18 @@ jobs:
8384
uses: "./.github/workflows/linux.yml"
8485
secrets: inherit
8586

86-
windows-macos:
87-
name: Windows/macOS
87+
macos:
88+
name: macOS
8889
needs: filter
8990
if: needs.filter.outputs.code == 'true'
90-
uses: "./.github/workflows/windows-macos.yml"
91+
uses: "./.github/workflows/macos.yml"
92+
secrets: inherit
93+
94+
windows:
95+
name: Windows
96+
needs: filter
97+
if: needs.filter.outputs.code == 'true'
98+
uses: "./.github/workflows/windows.yml"
9199
secrets: inherit
92100

93101
hooks:
@@ -100,7 +108,7 @@ jobs:
100108
name: Finalize
101109
runs-on: ubuntu-latest
102110
if: ${{ always() }}
103-
needs: [docs, lint, linux, windows-macos, hooks]
111+
needs: [docs, lint, linux, windows, macos, hooks]
104112
steps:
105113
- name: Docs failure check
106114
if: ${{
@@ -112,7 +120,8 @@ jobs:
112120
if: ${{
113121
needs.lint.result == 'failure' || needs.lint.result == 'cancelled' ||
114122
needs.linux.result == 'failure' || needs.linux.result == 'cancelled' ||
115-
needs.windows-macos.result == 'failure' || needs.windows-macos.result == 'cancelled'
123+
needs.windows.result == 'failure' || needs.windows.result == 'cancelled' ||
124+
needs.macos.result == 'failure' || needs.macos.result == 'cancelled'
116125
}}
117126
run: exit 1
118127

.github/workflows/lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ jobs:
9191
echo "Run '3rd-party/flutter/bin/dart format' to fix formatting."
9292
exit 1
9393
fi
94+
95+
- name: Check gui-less snapcraft.yaml is up to date
96+
shell: bash
97+
run: |
98+
pip install --quiet -r git-hooks/requirements.txt
99+
packaging/gui-less/generate-snapcraft.py --check

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- name: Determine job matrix
2525
id: set-matrix
26-
uses: actions/github-script@v8
26+
uses: actions/github-script@v9
2727
with:
2828
script: |
2929
const matrix = { include: [] };
Lines changed: 46 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: WindowsMacOS
1+
name: MacOS
22

33
on:
44
workflow_call:
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111

1212
concurrency:
13-
group: windows-macos-${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.run_id }}
13+
group: macos-${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.run_id }}
1414
cancel-in-progress: true
1515

1616
env:
@@ -33,18 +33,11 @@ jobs:
3333
steps:
3434
- name: Determine build matrix
3535
id: set-matrix
36-
uses: actions/github-script@v8
36+
uses: actions/github-script@v9
3737
with:
3838
script: |
3939
const matrix = { include: [] };
4040
41-
// Windows targets
42-
matrix.include.push({
43-
"name": "Windows Server 2025",
44-
"runs-on": "windows-2025"
45-
});
46-
47-
// macOS targets
4841
matrix.include.push({
4942
"name": "macOS Latest (Apple Silicon)",
5043
"runs-on": "macos-latest"
@@ -75,7 +68,6 @@ jobs:
7568
mac-arm-package-artifact-name: ${{ steps.publish-data.outputs.macos-latest-package-artifact-name }}
7669
mac-x86-package-file-name: ${{ steps.publish-data.outputs.macos-15-intel-package-file-name }}
7770
mac-arm-package-file-name: ${{ steps.publish-data.outputs.macos-latest-package-file-name }}
78-
windows-pkg-url: ${{ steps.publish-data.outputs.windows-2025-s3-url }}
7971

8072
name: Build and Test (${{ matrix.name }})
8173
runs-on: ${{ matrix.runs-on }}
@@ -101,20 +93,11 @@ jobs:
10193
with:
10294
xcode-version: '16.2'
10395

104-
- name: Enable symlinks
105-
if: ${{ runner.os == 'Windows' }}
106-
run: git config --local core.symlinks true
107-
108-
- name: Disable auto CRLF on Windows
109-
if: ${{ runner.os == 'Windows' }}
110-
run: git config --local core.autocrlf false
111-
11296
- name: Determine build parameters
11397
id: build-params
11498
uses: ./.github/actions/build-params
11599

116100
- name: Set preferred tar
117-
if: ${{ runner.os == 'macOS' }}
118101
id: preferred-tar
119102
run: |
120103
# Prepend gnu-tar's (future) location to the path, to prioritize it over system tar
@@ -123,13 +106,11 @@ jobs:
123106
124107
# TODO: find a friendlier approach for installing pip packages on GitHub runners
125108
- name: Force pip to allow break-system-packages via pip.conf
126-
if: ${{ runner.os == 'macOS' }}
127109
run: |
128110
mkdir -p ~/.pip
129111
echo -e "[install]\nbreak-system-packages = true" > ~/.pip/pip.conf
130112
131113
- name: Install dependencies from brew
132-
if: ${{ runner.os == 'macOS' }}
133114
run: |
134115
# Avoid reinstalling cmake
135116
brew list cmake > /dev/null || brew install cmake
@@ -158,22 +139,9 @@ jobs:
158139
brew link --overwrite nuget
159140
160141
- name: Install dependencies from pip
161-
if: ${{ runner.os == 'macOS' }}
162142
run: |
163143
python3 -m pip install --user --upgrade distlib
164144
165-
- name: Install specific QEMU from Choco
166-
if: ${{ runner.os == 'Windows' }}
167-
uses: crazy-max/ghaction-chocolatey@v4
168-
with:
169-
args: install --yes qemu --version=2023.4.24
170-
171-
- name: Install other packages from Choco
172-
if: ${{ runner.os == 'Windows' }}
173-
uses: crazy-max/ghaction-chocolatey@v4
174-
with:
175-
args: install --yes wget unzip
176-
177145
- name: Set up vcpkg
178146
id: setup-vcpkg
179147
uses: lukka/run-vcpkg@v11
@@ -192,13 +160,12 @@ jobs:
192160
NUGET_PATH="$($VCPKG_ROOT/vcpkg fetch nuget | tail -n 1)"
193161
MONO_WRAPPER=""
194162
195-
if [[ "$RUNNER_OS" == "macOS" ]]; then
196-
# Check if we actually need to call NuGet through mono.
197-
# That would be the case if NuGet is the real PE32 executable
198-
# instead of a shim.
199-
if file "$NUGET_PATH" | grep -q "PE32"; then
200-
MONO_WRAPPER="mono"
201-
fi
163+
164+
# Check if we actually need to call NuGet through mono.
165+
# That would be the case if NuGet is the real PE32 executable
166+
# instead of a shim.
167+
if file "$NUGET_PATH" | grep -q "PE32"; then
168+
MONO_WRAPPER="mono"
202169
fi
203170
204171
$MONO_WRAPPER "$NUGET_PATH" \
@@ -248,20 +215,6 @@ jobs:
248215
with:
249216
version: "v0.12.0"
250217

251-
- name: Install Windows ADK
252-
if: ${{ runner.os == 'Windows' }}
253-
uses: crazy-max/ghaction-chocolatey@v4
254-
with:
255-
args: install --yes windows-adk-deploy
256-
257-
- name: Install cmake
258-
if: ${{ runner.os == 'Windows' }}
259-
uses: lukka/[email protected]
260-
261-
- name: Set up MSVC
262-
if: ${{ runner.os == 'Windows' }}
263-
uses: ilammy/msvc-dev-cmd@v1
264-
265218
- name: Configure
266219
run: >
267220
cmake
@@ -270,42 +223,67 @@ jobs:
270223
-GNinja
271224
-DMULTIPASS_UPSTREAM=origin
272225
-DMULTIPASS_BUILD_LABEL=${{ steps.build-params.outputs.label }}
273-
${{ runner.os == 'Windows' && '-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe' || '' }}
274226
${{ github.event_name == 'schedule' && '-DMP_ALLOW_OPTIONAL_FEATURES=OFF' || '' }}
275227
${{ github.workspace }}
276228
277229
- name: Build
278230
run: cmake --build ${{ env.BUILD_DIR }}
279231

232+
- name: Enable core dump generation
233+
working-directory: ${{ env.BUILD_DIR }}
234+
shell: bash
235+
run : |
236+
# Allow core dumps
237+
sudo sysctl -w kern.coredump=1
238+
# This entitlement is needed for a proc to produce a coredump
239+
/usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" segv.entitlements
240+
# Code-sign the test executable to grant core dump entitlement
241+
codesign -s - -f --entitlements segv.entitlements bin/multipass_tests
242+
# Ensure destination exists and is writable
243+
sudo mkdir -p /cores || true
244+
sudo chmod 1777 /cores
245+
# Print syctl coredump parameters
246+
sysctl kern.coredump kern.corefile
247+
ulimit -a
248+
ulimit -Hc
249+
280250
- name: Run unit tests
281251
working-directory: ${{ env.BUILD_DIR }}
282252
run: |
253+
# Catch and save the test executable's exit code
254+
trap 'echo "MULTIPASS_TESTS_EXIT_CODE=$?" >> $GITHUB_ENV' EXIT
255+
# Set soft limit for the core file size (512MiB)
256+
ulimit -c 1048576
283257
bin/multipass_tests
284258
285259
- name: Run integration tests
286260
working-directory: ${{ env.BUILD_DIR }}
287261
run: |
288262
bin/multipass_integration_tests
289263
264+
- name: Upload test coredump
265+
uses: actions/upload-artifact@v7
266+
if: ${{ failure() && env.MULTIPASS_TESTS_EXIT_CODE != '0' }}
267+
with:
268+
name: buildandtest-test-crash-${{ matrix.runs-on }}-${{ matrix.build-type }}
269+
retention-days: 7
270+
path: |
271+
/cores/**
272+
${{ env.BUILD_DIR }}/bin/multipass_tests
273+
290274
- name: Package
291275
id: cmake-package
292276
working-directory: ${{ env.BUILD_DIR }}
293277
run: >
294278
cmake --build . --target package
295279
296-
echo "name=$( ${{ runner.os != 'Windows' && 'basename *.pkg' ||
297-
'( Get-ChildItem .\packages\en-US\multipass-*.msi ).Name' }} ) " >>
298-
${{ runner.os != 'Windows' && '$GITHUB_OUTPUT' || '$env:GITHUB_OUTPUT' }}
280+
echo "name=$( basename *.pkg )" >> $GITHUB_OUTPUT
299281
300-
echo "path=$( ${{ runner.os != 'Windows' && 'greadlink -f *.pkg' ||
301-
'( Get-ChildItem .\packages\en-US\multipass-*.msi ).FullName' }} )" >>
302-
${{ runner.os != 'Windows' && '$GITHUB_OUTPUT' || '$env:GITHUB_OUTPUT' }}
282+
echo "path=$( greadlink -f *.pkg )" >> $GITHUB_OUTPUT
303283
304284
- name: Get package logs
305285
if: ${{ failure() && steps.cmake-package.outcome == 'failure' }}
306-
run: >
307-
${{ format('cat {0}/_CPack_Packages/{1}', env.BUILD_DIR,
308-
runner.os == 'Windows' && 'win64/External/WiXOutput.log' || 'Darwin/productbuild/InstallOutput.log') }}
286+
run: cat ${{ env.BUILD_DIR }}/_CPack_Packages/Darwin/productbuild/InstallOutput.log
309287

310288
- name: Upload package
311289
uses: actions/upload-artifact@v7
@@ -371,7 +349,6 @@ jobs:
371349

372350
# TODO: find a friendlier approach for installing pip packages on GitHub runners
373351
- name: Force pip to allow break-system-packages via pip.conf
374-
if: ${{ runner.os == 'macOS' }}
375352
run: |
376353
mkdir -p ~/.pip
377354
echo -e "[install]\nbreak-system-packages = true" > ~/.pip/pip.conf
@@ -435,21 +412,7 @@ jobs:
435412
run: |
436413
echo "##[warning] Public URL: ${{ steps.s3-upload.outputs.url }}"
437414
438-
DispatchCLITestsWorkflowWin:
439-
name: "Dispatch CLI Tests (Windows)"
440-
permissions:
441-
contents: read
442-
actions: read
443-
checks: write
444-
secrets: inherit
445-
needs:
446-
- BuildAndTest
447-
uses: ./.github/workflows/cli-tests.yml
448-
with:
449-
windows-pkg-url: ${{ needs.BuildAndTest.outputs.windows-pkg-url }}
450-
backend-driver: hyperv_api
451-
452-
DispatchCLITestsWorkflowMac:
415+
DispatchCLITestsWorkflow:
453416
name: "Dispatch CLI Tests (macOS)"
454417
permissions:
455418
contents: read
@@ -492,6 +455,6 @@ jobs:
492455
MATTERMOST_CHANNEL: multipass
493456
TEXT: |
494457
:red_circle: @mp
495-
Scheduled [WindowsMacOS](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow exited before completing.
458+
Scheduled [MacOS](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow exited before completing.
496459
MATTERMOST_USERNAME: ${{ github.triggering_actor }}
497460
MATTERMOST_ICON_URL: https://www.flaticon.com/free-icon/github-logo_25231

.github/workflows/prune-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Collect package names
2323
id: collect
24-
uses: actions/github-script@v8
24+
uses: actions/github-script@v9
2525
with:
2626
script: |
2727
const owner = context.repo.owner;

0 commit comments

Comments
 (0)