Skip to content

Commit

Permalink
Enable GitHub CI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams authored Feb 13, 2024
1 parent b0982e1 commit 866759d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Build and test

"on":
push:
branches: ["**"]

jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
configuration: [Debug, Release]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
show-progress: false

- name: Setup Swift
if: ${{ matrix.os != 'macos-latest' }}
uses: SwiftyLab/setup-swift@latest
with:
swift-version: 5.9

- uses: seanmiddleditch/gha-setup-ninja@v4
with:
version: 1.11.1

- name: Native CTest
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DENABLE_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/[email protected]
with:
runCmd: cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DENABLE_TESTING=1 -GNinja -S . -B .devcontainer-build && cmake --build .devcontainer-build && ctest -V --test-dir .devcontainer-build

- name: 'Xcode (build only—"error: Scheme DummyTestee is not currently configured for the test action.")'
if: ${{ matrix.os == 'macos-latest' }}
run: |
cmake -DENABLE_TESTING=1 -GXcode -S . -B .xcode-build
cd .xcode-build
xcrun xcodebuild -configuration ${{ matrix.configuration }} -scheme DummyTestee -destination 'platform=macOS' build-for-testing
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
/.vscode

0 comments on commit 866759d

Please sign in to comment.