Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: ./.github/workflows/swift_package_test.yml
with:
# Linux
linux_os_versions: '["jammy", "rhel-ubi9"]'
linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2"]'
linux_build_command: |
mkdir MyPackage
cd MyPackage
Expand Down
51 changes: 48 additions & 3 deletions .github/workflows/swift_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ jobs:
run: swift --version
- name: Checkout repository
uses: actions/checkout@v4
if: ${{ matrix.os_version != 'amazonlinux2' }}
- name: Checkout repository
uses: actions/checkout@v1
if: ${{ matrix.os_version == 'amazonlinux2' }}
- name: Provide token
if: ${{ inputs.needs_token }}
run: |
Expand Down Expand Up @@ -232,6 +236,10 @@ jobs:
run: swift --version
- name: Checkout repository
uses: actions/checkout@v4
if: ${{ matrix.os_version != 'amazonlinux2' }}
- name: Checkout repository
uses: actions/checkout@v1
if: ${{ matrix.os_version == 'amazonlinux2' }}
- name: Provide token
if: ${{ inputs.needs_token }}
run: |
Expand All @@ -250,7 +258,18 @@ jobs:
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
run: |
${{ inputs.linux_static_sdk_pre_build_command }}
which curl || (apt -q update && apt -yq install curl)
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
apt-get -q update && apt-get -yq install curl
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
dnf -y update
dnf -y install curl-minimal
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
yum -y update
yum -y install curl
else
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
exit 1
fi
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
bash -s -- --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }}

Expand All @@ -272,6 +291,10 @@ jobs:
run: swift --version
- name: Checkout repository
uses: actions/checkout@v4
if: ${{ matrix.os_version != 'amazonlinux2' }}
- name: Checkout repository
uses: actions/checkout@v1
if: ${{ matrix.os_version == 'amazonlinux2' }}
- name: Provide token
if: ${{ inputs.needs_token }}
run: |
Expand All @@ -290,7 +313,18 @@ jobs:
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
run: |
${{ inputs.wasm_sdk_pre_build_command }}
which curl || (apt -q update && apt -yq install curl)
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
apt-get -q update && apt-get -yq install curl
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
dnf -y update
dnf -y install curl-minimal
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
yum -y update
yum -y install curl
else
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
exit 1
fi
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
bash -s -- --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }}

Expand Down Expand Up @@ -330,7 +364,18 @@ jobs:
BUILD_FLAGS: ${{ (contains(matrix.swift_version, 'nightly') && inputs.swift_nightly_flags) || inputs.swift_flags }}
run: |
${{ inputs.wasm_sdk_pre_build_command }}
which curl || (apt -q update && apt -yq install curl)
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
apt-get -q update && apt-get -yq install curl
elif command -v dnf >/dev/null 2>&1 ; then # rhel-ubi9
dnf -y update
dnf -y install curl-minimal
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
yum -y update
yum -y install curl
else
echo "Unknown package manager (tried apt-get, dnf, yum)" >&2
exit 1
fi
curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \
bash -s -- --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }}

Expand Down