From cca85d25d6c2030abe35d9c02a16a53f07b2e09d Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 13 Mar 2024 14:44:25 +0800 Subject: [PATCH] Add SwiftPM Github CI support --- .github/workflows/swiftpm.yml | 38 +++++++++++++++++++++++++++++++++++ README.md | 4 ++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/swiftpm.yml diff --git a/.github/workflows/swiftpm.yml b/.github/workflows/swiftpm.yml new file mode 100644 index 0000000..b6443b7 --- /dev/null +++ b/.github/workflows/swiftpm.yml @@ -0,0 +1,38 @@ +name: SwiftPM Build CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + swiftpm_macos_test: + name: Build with SwiftPM on macOS + strategy: + fail-fast: false + matrix: + os: [macos-13, macos-14] + xcode-version: ["15.2"] + target: ["Life", "SwiftBreak"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode-version }} + - uses: SwiftyLab/setup-swift@latest + with: + development: true + swift-version: latest + check-latest: true + - name: Install Playdate SDK + id: playdate + uses: pd-rs/get-playdate-sdk@0.1.6 + with: + version: 2.4.1 + - name: Build with SwiftPM for ${{ matrix.TARGET }} + working-directory: Examples/${{ matrix.TARGET }} + run: | + swift build -c release diff --git a/README.md b/README.md index 3d1835b..4639dc0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ A technical demonstration of Embedded Swift running on Playdate by Panic +| **CI Status** | +|---| +|[![SwiftPM Build](https://github.com/apple/swift-playdate-examples/actions/workflows/swiftpm.yml/badge.svg)](https://github.com/apple/swift-playdate-examples/actions/workflows/swiftpm.yml)| + ## Why Swift for Playdate The [Playdate](https://play.date) is a tiny handheld gaming console developed by [Panic](https://panic.com) featuring a Cortex M7 processor and a 400 by 240 1-bit display. Panic provides an SDK for building Playdate games in both C and Lua and is equipped with a Playdate Simulator.