Update Tests.yml #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Download and Install Swift 6.0 | |
run: | | |
# Define the Swift package URL | |
SWIFT_URL="https://swift.org/builds/swift-6.0-release/xcode/swift-6.0-RELEASE/swift-6.0-RELEASE-osx.pkg" | |
# Download the Swift package | |
curl -fSL "$SWIFT_URL" -o swift.pkg | |
# Check if the file was downloaded successfully | |
if [ ! -f swift.pkg ]; then | |
echo "Swift package download failed!" | |
exit 1 | |
fi | |
# Install the downloaded Swift package | |
sudo installer -pkg swift.pkg -target / | |
# Verify the Swift version | |
swift --version | |
- name: Build | |
run: swift build -v | |
- name: Run tests | |
run: swift test -v |