chore: add GItHub CI Action for project

This commit is contained in:
CMK 2021-04-21 23:58:36 +08:00
parent f6e785a894
commit a1b19e44f7
3 changed files with 44 additions and 0 deletions

13
.github/scripts/build.sh vendored Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -eo pipefail
# build with SwiftPM:
# https://developer.apple.com/documentation/swift_packages/building_swift_packages_or_apps_that_use_them_in_continuous_integration_workflows
xcodebuild -workspace Mastodon.xcworkspace \
-scheme Mastodon \
-disableAutomaticPackageResolution \
-destination "platform=iOS Simulator,name=iPhone SE (2nd generation)" \
clean \
build | xcpretty

4
.github/scripts/setup.sh vendored Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
sudo gem install cocoapods-keys
pod install

27
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: CI
on:
push:
branches:
- master
- develop
- feature/*
pull_request:
branches:
- develop
# macOS environments: https://github.com/actions/virtual-environments/tree/main/images/macos
jobs:
build:
name: CI build
runs-on: macos-11.0
steps:
- name: checkout
uses: actions/checkout@v2
- name: force Xcode 12.2
run: sudo xcode-select -switch /Applications/Xcode_12.2.app
- name: setup
run: exec ./.github/scripts/setup.sh
- name: build
run: exec ./.github/scripts/build.sh