Skip to content

Conversation

@kateinoigakukun
Copy link
Contributor

@kateinoigakukun kateinoigakukun commented Aug 2, 2025

Add build check CI for WebAssembly SDK

Motivation:

Add build check CI for WebAssembly SDK

Modifications:

Add only reusable GHA workflow from #3159 to gracefully merge changes without breaking CI.

After this change being merged into main branch, we can merge the actual PR checks: #3331

Result:

Setting up the CI job makes it easier to detect such incompatibility before merging.

@kateinoigakukun kateinoigakukun changed the title [wasm][1/3] Add reusable WebAssembly workflow [wasm][1/2] Add reusable WebAssembly workflow Aug 2, 2025
@MaxDesiatov
Copy link
Member

This is potentially superseded by swiftlang/github-workflows#142

@kateinoigakukun kateinoigakukun force-pushed the katei/add-reusable-wasm-workflow branch from 5e6da08 to ebb34ad Compare August 3, 2025 07:58
@kateinoigakukun
Copy link
Contributor Author

We still need this separate PR to add a reusable workflow based on swiftlang/github-workflows#142

@FranzBusch
Copy link
Member

This is potentially superseded by swiftlang/github-workflows#142

This is not suppressed by it because NIO and all other server repos are not using the workflows provided by the linked repo due to their limited capabilities.

@Lukasa Lukasa added the semver/none No version bump required. label Aug 4, 2025
@Lukasa Lukasa enabled auto-merge (squash) August 4, 2025 13:46
@Lukasa Lukasa merged commit a114cfb into apple:main Aug 4, 2025
47 of 48 checks passed
Comment on lines +14 to +15
swift_flags: --target NIOCore
swift_nightly_flags: --target NIOCore
Copy link

@kkebo kkebo Aug 7, 2025

Choose a reason for hiding this comment

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

FYI: Thanks to swiftlang/github-workflows#149, these two lines can be shortened into one line.

Suggested change
swift_flags: --target NIOCore
swift_nightly_flags: --target NIOCore
wasm_sdk_build_command: swift build --target NIOCore

Copy link
Member

Choose a reason for hiding this comment

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

IIRC swift_nightly_flags in absence of a defined value is auto-populated from swift_flags, so the workflow here should just specify the latter without a need for wasm_sdk_build_command.

Copy link

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I may be missing something, but there's || inputs.swift_flags on the line you've linked to?

Copy link

Choose a reason for hiding this comment

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

Yes, I linked to the following line.

BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}

Copy link

Choose a reason for hiding this comment

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

This is a ternary operator.

Copy link
Member

@MaxDesiatov MaxDesiatov Aug 7, 2025

Choose a reason for hiding this comment

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

I don't think so. If swift_nightly_flags is undefined, the first operand of || is falsy, which then evaluates to the second operand swift_flags. You can also see swift_flags respected for nightlies in this workflow, where swift_nightly_flags is not defined at all https://github.com/swiftlang/swift-for-wasm-examples/blob/main/.github/workflows/pull_request.yml

Copy link

@kkebo kkebo Aug 7, 2025

Choose a reason for hiding this comment

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

Sorry, I was wrong. I didn't expect that the empty string was falsy. Thank you.

Lukasa pushed a commit that referenced this pull request Aug 11, 2025
…3332)

Add build check CI for WebAssembly SDK

### Motivation:

Add build check CI for WebAssembly SDK

### Modifications:

Add Wasm build checks in `main.yml` and `pull_request.yml` based on
#3331

Extracted from #3159

### Result:

Setting up the CI job makes it easier to detect such incompatibility
before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants