From a1b19e44f7d5ca373b06e2c2f86f8df49898bf2f Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 21 Apr 2021 23:58:36 +0800 Subject: [PATCH] chore: add GItHub CI Action for project --- .github/scripts/build.sh | 13 +++++++++++++ .github/scripts/setup.sh | 4 ++++ .github/workflows/main.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 .github/scripts/build.sh create mode 100755 .github/scripts/setup.sh create mode 100644 .github/workflows/main.yml diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh new file mode 100755 index 000000000..76e65f49f --- /dev/null +++ b/.github/scripts/build.sh @@ -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 \ No newline at end of file diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh new file mode 100755 index 000000000..e1411fb50 --- /dev/null +++ b/.github/scripts/setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sudo gem install cocoapods-keys +pod install \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..67670b46c --- /dev/null +++ b/.github/workflows/main.yml @@ -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