Update Script.swift (#21) #68
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: swift test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test-on-mac: | |
name: Test on macOS | |
strategy: | |
matrix: | |
xcode-version: | |
- /Applications/Xcode_15.0.app | |
- /Applications/Xcode_14.3.1.app | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: sudo xcode-select -s "${{ matrix.xcode-version }}" || true | |
- run: swift --version | |
- run: swift build --build-tests | |
- run: swift test | |
test-on-ubuntu: | |
name: Test on Ubuntu | |
strategy: | |
matrix: | |
swift-version: ["5.7", "5.8"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup swiftenv | |
run: | | |
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv | |
export SWIFTENV_ROOT="$HOME/.swiftenv" | |
export PATH="$SWIFTENV_ROOT/bin:$PATH" | |
eval "$(swiftenv init -)" | |
echo "$PATH" >> $GITHUB_PATH | |
- name: Install Swift | |
run: swiftenv install "${{ matrix.swift-version }}" --skip-existing | |
- run: swift --version | |
- run: swift build --build-tests --enable-test-discovery | |
- run: swift test --enable-test-discovery |