Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate build_msi into main CI workflow #121778

Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
# }}
#
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
run-win-msi: ${{ steps.win-msi-changes.outputs.run-win-msi || false }}
run_tests: ${{ steps.check.outputs.run_tests || false }}
run_hypothesis: ${{ steps.check.outputs.run_hypothesis || false }}
run_cifuzz: ${{ steps.check.outputs.run_cifuzz || false }}
Expand Down Expand Up @@ -123,6 +124,20 @@ jobs:
id: docs-changes
run: |
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
- name: Get a list of the MSI installer-related files
id: changed-win-msi-files
uses: Ana06/get-changed-files@v2.3.0
with:
filter: |
Tools/msi/**
.github/workflows/reusable-windows-msi.yml
format: csv # works for paths with spaces
- name: Check for changes in MSI installer-related files
if: >-
steps.changed-win-msi-files.outputs.added_modified_renamed != ''
id: win-msi-changes
run: |
echo "run-win-msi=true" >> "${GITHUB_OUTPUT}"

check-docs:
name: Docs
Expand Down Expand Up @@ -218,6 +233,21 @@ jobs:
arch: ${{ matrix.arch }}
free-threading: ${{ matrix.free-threading }}

build_windows_msi:
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
Windows MSI${{ '' }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webknjaz Someone else has said "Tests / Windows MSI${{ '' }} (pull_request)" looks like a bug.

I think in some other thread you said we can adjust it somehow, is that possible?

Copy link
Contributor Author

@webknjaz webknjaz Aug 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hugovk basically, there are two options:

  • split this into two matrices in the top-level workflow
  • move the interpolated part of the name into the reusable ones

I personally like the second option. Let me know if you or @ambv want something different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, I think both might break grouping 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, any other ideas? Someone else has asked about it because it looks weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be most impactful if GitHub fixed this in its own UI rather than having people resort to hacks. I'd be happy to drop the ${{ '' }} hack from other places.

Would it be less confusing is we switched Windows MSI${{ '' }} to ${{ 'Windows MSI' }}?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would that look for the different builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same, just bits of syntax would be around the string, not after.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that might be a bit better?

The recent query was actually about the fromJSON stuff, do you think we can do anything about that?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicating the matrix or moving the conditional inside the reusable workflow would improve this, I suppose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some thinking and realized that duplicating the matrices is the only way to make it look different while preserving the matrix grouping in the UI.

needs: check_source
if: fromJSON(needs.check_source.outputs.run-win-msi)
strategy:
matrix:
arch:
- x86
- x64
- arm64
uses: ./.github/workflows/reusable-windows-msi.yml
with:
arch: ${{ matrix.arch }}

build_macos:
name: 'macOS'
needs: check_source
Expand Down Expand Up @@ -571,6 +601,7 @@ jobs:
- build_ubuntu_ssltests
- build_wasi
- build_windows
- build_windows_msi
- test_hypothesis
- build_asan
- build_tsan
Expand All @@ -585,6 +616,7 @@ jobs:
with:
allowed-failures: >-
build_ubuntu_ssltests,
build_windows_msi,
cifuzz,
test_hypothesis,
allowed-skips: >-
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/build_msi.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/reusable-windows-msi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: TestsMSI

on:
workflow_call:
inputs:
arch:
description: CPU architecture
required: true
type: string

permissions:
contents: read

jobs:
build:
name: installer for ${{ inputs.arch }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the name will be qualified in some other way?

Suggested change
name: installer for ${{ inputs.arch }}
name: Windows installer for ${{ inputs.arch }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already prefixed with "windows" on the calling side. I intentionally didn't add it here. The UI side is fine.

Copy link
Contributor Author

@webknjaz webknjaz Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot_2024-07-24-10-41-25-10_320a9a695de7cdce83ed5281148d6f19.jpg

Screenshot_2024-07-24-10-42-35-22_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

Screenshot_2024-07-24-10-43-39-56_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the screenshots above, it's visible that it's also consistent with other reusable workflows.

runs-on: windows-latest
timeout-minutes: 60
env:
IncludeFreethreaded: true
steps:
- uses: actions/checkout@v4
- name: Build CPython installer
run: .\Tools\msi\build.bat --doc -${{ inputs.arch }}
Loading