Skip to content

Commit

Permalink
special hack for swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
omochi committed Jun 10, 2024
1 parent b5697f7 commit 27f93cc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 40 deletions.
69 changes: 32 additions & 37 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
swift-install:
dir: "swift-6.0-branch/xcode"
version: "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-08-a"
# - os: macos-14
# xcode: "15.4"
# swift: "5.10"
# - os: macos-13
# xcode: "15.2"
# swift: "5.9.2"
- os: macos-14
xcode: "15.4"
swift: "5.10"
- os: macos-13
xcode: "15.2"
swift: "5.9.2"

steps:
- name: Checkout the repository
Expand All @@ -41,8 +41,6 @@ jobs:
SWIFT_DIR: ${{ matrix.swift-install.dir }}
SWIFT_VERSION: ${{ matrix.swift-install.version }}

- run: env

- name: Check Swift version
run: swift --version

Expand All @@ -57,38 +55,35 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# swift-test-linux:
# name: Build and test on Linux with Swift ${{ matrix.swift.version }}
# timeout-minutes: 40
# runs-on: ubuntu-22.04
# steps:
# - name: Skip now
# run: echo hello world

# - name: Checkout the repository
# uses: actions/checkout@v4
swift-test-linux:
name: Build and test on Linux with Swift ${{ matrix.swift.version }}
timeout-minutes: 40
runs-on: ubuntu-22.04
steps:
- name: Checkout the repository
uses: actions/checkout@v4

# - name: Install Swift toolchain
# uses: ./.github/actions/install-swift
# with:
# swift-dir: ${{ matrix.swift.dir }}
# swift-version: ${{ matrix.swift.version }}
- name: Install Swift toolchain
uses: ./.github/actions/install-swift
with:
swift-dir: ${{ matrix.swift.dir }}
swift-version: ${{ matrix.swift.version }}

# - name: Check Swift version
# run: swift --version
- name: Check Swift version
run: swift --version

# - name: Install dependent packages for WebAssembly
# run: >
# sudo apt-get update && sudo apt-get install -y
# wabt binaryen
- name: Install dependent packages for WebAssembly
run: >
sudo apt-get update && sudo apt-get install -y
wabt binaryen
# - name: Install WebAssembly runtime
# uses: bytecodealliance/actions/wasmtime/setup@v1
- name: Install WebAssembly runtime
uses: bytecodealliance/actions/wasmtime/setup@v1

# - name: Build the project
# run: swift build --build-tests
- name: Build the project
run: swift build --build-tests

# - name: Run tests
# run: swift test
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: swift test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 10 additions & 3 deletions ci/mac/install-swift.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ cd install
set -x
pwd
curl -fLO https://download.swift.org/${SWIFT_DIR}/${SWIFT_VERSION}/${SWIFT_VERSION}-osx.pkg
sudo installer -target CurrentUserHomeDirectory -pkg ${SWIFT_VERSION}-osx.pkg
installer -target CurrentUserHomeDirectory -pkg ${SWIFT_VERSION}-osx.pkg

toolchain=~/Library/Developer/Toolchains/${SWIFT_VERSION}.xctoolchain

set +x
swift_id=$(plutil -extract CFBundleIdentifier raw \
~/Library/Developer/Toolchains/${SWIFT_VERSION}.xctoolchain/Info.plist)
swift_id=$(plutil -extract CFBundleIdentifier raw ${toolchain}/Info.plist)

set -x
echo "TOOLCHAINS=${swift_id}" >> $GITHUB_ENV

# https://github.com/apple/swift/issues/73327#issuecomment-2120481479
find ${toolchain}/usr/bin -type f | xargs -n 1 -I {} \
sudo codesign --force --preserve-metadata=identifier,entitlements --sign - {}

echo "DYLD_LIBRARY_PATH=${toolchain}/usr/lib/swift/macosx" >> $GITHUB_ENV

0 comments on commit 27f93cc

Please sign in to comment.