Skip to content

CMake: Fix a URL; favor bullet-proofing over terseness. #30

CMake: Fix a URL; favor bullet-proofing over terseness.

CMake: Fix a URL; favor bullet-proofing over terseness. #30

Workflow file for this run

---
name: Build and test
"on":
push:
branches: ["**"]
env:
swift-version: '5.9'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [macos-13, ubuntu-latest, windows-latest]
configuration: [Debug, Release]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: 'Set up swift (*nix)'
if: ${{ matrix.os != 'windows-latest' }}
uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ env.swift-version }}
- uses: compnerd/gha-setup-vsdevenv@main
- name: Set up swift (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: compnerd/gha-setup-swift@v0.2.1
with:
branch: swift-${{ env.swift-version }}-release
tag: ${{ env.swift-version }}-RELEASE
- name: Verify swift version
run: ${{ matrix.os == 'macos-13' && 'xcrun' || '' }} swift --version
- uses: seanmiddleditch/gha-setup-ninja@v4
with:
version: 1.11.1
- name: Native CTest
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DBUILD_TESTING=1 -GNinja -S . -B .cmake-build && cmake --build .cmake-build && ctest -V --test-dir .cmake-build
- name: Devcontainer CTest
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: devcontainers/ci@v0.3
with:
runCmd: cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DBUILD_TESTING=1 -GNinja -S . -B .devcontainer-build && cmake --build .devcontainer-build && ctest -V --test-dir .devcontainer-build
- name: Xcode
if: ${{ matrix.os == 'macos-13' }}
run: |
cmake -D BUILD_TESTING=1 -G Xcode -S . -B .xcode-build
cd .xcode-build
xcrun xcodebuild -configuration ${{ matrix.configuration }} -scheme DummyTestee -destination 'platform=macOS' test
- name: Swift Package Manager
run: swift test -Xswiftc -DBUILDING_WITH_SWIFT_PACKAGE_MANAGER