gha-swift-env
is a GitHub Action that sets up a Swift environment for cross-platform(macOS, Ubuntu Linux, and Windows).
And it also automatically installs Ninja, which is required for building a Swift code with CMake.
You can set the Swift version of the release.
- uses: sushichop/gha-swift-env@v1
with:
swift-version: '5.6'
- name: Show Swift version and build a Swift package
run: |
swift --version
swift build -v -c release
You can also set the Swift version of the snapshot.
- uses: sushichop/gha-swift-env@v1
with:
swift-version: '2022-07-20-a'
- name: Show Swift version and build a Swift package
run: |
swift --version
swift build -v -c release
You can build and test a Swift package on cross-platform(macOS, Ubuntu Linux, and Windows).
on
pull_request:
jobs:
swiftpm:
name: SwiftPM - Swift ${{ matrix.swift-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['macos-11', 'ubuntu-latest', 'windows-latest']
swift-version: ['5.6', '2022-07-20-a']
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: sushichop/gha-swift-env@V1
with:
swift-version: ${{ matrix.swift-version }}
- name: Build and test a Swift package
run: |
swift build -v -c release
swift test -v -Xswiftc -warnings-as-errors
You can also build a Swift package with CMake and Ninja.
- uses: sushichop/gha-swift-env@v1
with:
swift-version: '5.4.2'
- name: Build with CMake and Ninja
run: |
cmake -B ./build -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja -S .
ninja -C ./build -v
swift-version
– (required) Swift version to use
'5.4.2'
, '5.6'
, '2022-01-09-a'
, ...'5.4.2'
winsdk-version
– (optional) WinSDK to use on Windows
''
, '10.019041.0'
, '10.0.20348.0'
, ...''
gha-swift-env
is available under the MIT license. See the LICENSE file for details.
link |
Stars: 4 |
Last commit: 41 weeks ago |
actions/setup-node
.Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics