Skip to content

Add workflow for testing Musl #40

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/swift_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
type: string
description: "Linux command to execute before building the Swift package"
default: ""
musl_pre_build_command:
type: string
description: "Linux command to execute before building the Swift package"

Choose a reason for hiding this comment

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

I think the description here just needs updated, as it's the same as the linux_pre_build_command

default: ""
linux_build_command:
type: string
description: "Linux Build command default is swift test"
Expand All @@ -35,13 +39,21 @@ on:
type: string
description: "Linux Build command default is swift test"
default: "swift test"
musl_build_command:
type: string
description: "MUSL Build command default is swift test"
default: "swift test"
linux_env_vars:
description: "List of environment variables"
type: string
enable_windows_checks:
type: boolean
description: "Boolean to enable windows testing. Defaults to true."
default: true
enable_musl_checks:
type: boolean
description: "Boolean to enable musl testing. Defaults to true."
default: true

jobs:
linux-build:
Expand Down Expand Up @@ -110,3 +122,27 @@ jobs:
- name: Build / Test
timeout-minutes: 60
run: docker run -v ${{ github.workspace }}:C:\source swiftlang/swift:${{ matrix.swift_version }}-windowsservercore-1809 cmd /s /c "swift --version & swift test --version & cd C:\source\ & ${{ inputs.windows_build_command }} ${{ inputs.swift_nightly_flags }}"

musl-build:
name: MUSL
if: ${{ inputs.enable_musl_checks }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
container: swift:6.0-noble
Copy link
Contributor

Choose a reason for hiding this comment

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

The version here must be exactly the same as the SDK below. As of today (30/10) swift:6.0-noble vends Swift 6.0.2 which is not working with the SDK 6.0.1.

I suggest to pass both the Swift version number and the checksum as parameters

steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install SDK
run: swift sdk install https://download.swift.org/swift-6.0.1-release/static-sdk/swift-6.0.1-RELEASE/swift-6.0.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum d4f46ba40e11e697387468e18987ee622908bc350310d8af54eb5e17c2ff5481

Choose a reason for hiding this comment

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

do we want a hardcoded checksum/artifact url hardcoded here? Or should they be inputs

- name: Set environment variables
if: ${{ inputs.linux_env_vars }}
run: |
for i in "${{ inputs.linux_env_vars }}"
do
printf "%s\n" $i >> $GITHUB_ENV
done
- name: Pre-build
run: ${{ inputs.musl_pre_build_command }}
- name: Build / Test
run: ${{ inputs.musl_build_command }} ${{ inputs.swift_flags }}