Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SwiftPM GitHub CI support #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/swiftpm.yml
Original file line number Diff line number Diff line change
@@ -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"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xcode version does not matter here on SwiftPM CI as we are using nightly Swift toolchain here.

Xcode 15.3 is not used because the upstream runner does not support it yet.

actions/runner-images#9459

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you prefer to use the latest nightly toolchain or use a fixed nightly version here?

check-latest: true
- name: Install Playdate SDK
id: playdate
uses: pd-rs/[email protected]
with:
version: 2.4.1
Copy link
Contributor Author

@Kyle-Ye Kyle-Ye Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Fixed version: "2.4.1" (The current latest version)
  2. Fixed version: "2.1.1" (Aligned with the current documentation description and screenshot)
  3. Dynamic version: "latest" (Update automatically when there is a new version)

- name: Build with SwiftPM for ${{ matrix.TARGET }}
working-directory: Examples/${{ matrix.TARGET }}
run: |
swift build -c release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TOOLCHAIN=xx is injected into env automatically in SwiftyLab/setup-swift@latest step

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down