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 CI #18

Open
wants to merge 2 commits 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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- "*"

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
mac:
name: MacOS 12
runs-on: macos-12
strategy:
matrix:
xcode: ["14.2"]
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Print Swift version
run: swift --version
- name: Run test
run: make test-swift

linux:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run test
run: make test-linux
38 changes: 12 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
PLATFORM_MACOS = macOS
PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p) (2nd generation)
test-all: test-swift test-linux

default: test-all
test-swift:
swift test --parallel

test-all: test-ios test-macos test-tvos

test-ios:
xcodebuild test \
-scheme Realtime \
-destination platform="$(PLATFORM_IOS)"

test-macos:
xcodebuild test \
-scheme Realtime \
-destination platform="$(PLATFORM_MACOS)"

test-tvos:
xcodebuild test \
-scheme Realtime \
-destination platform="$(PLATFORM_TVOS)"
test-linux:
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.5 \
bash -c 'make test-swift'

format:
swift format \
--ignore-unparsable-files \
--in-place \
--recursive \
./Package.swift ./Sources ./Tests
swift format --in-place --recursive .


.PHONY: format test-all test-ios test-macos test-tvos
.PHONY: test-swift test-linux format