From 012e43ff8e7d19f2048572f9a6c144350e8d7f96 Mon Sep 17 00:00:00 2001 From: uhooi Date: Sat, 29 Aug 2020 17:22:16 +0900 Subject: [PATCH 1/5] Add Makefile --- Makefile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f40c005 --- /dev/null +++ b/Makefile @@ -0,0 +1,54 @@ +PRODUCT_NAME := UhooiPicBook +WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace +SCHEME_NAME := ${PRODUCT_NAME} +UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests + +TEST_SDK := iphonesimulator +TEST_CONFIGURATION := Debug +TEST_PLATFORM := iOS Simulator +TEST_DEVICE ?= iPhone 11 Pro Max +TEST_OS ?= 13.6 +TEST_DESTINATION := 'platform=${TEST_PLATFORM},name=${TEST_DEVICE},OS=${TEST_OS}' + +.PHONY: install-bundler +install-bundler: + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + +.PHONY: install-cocoapods +install-cocoapods: + bundle exec pod install + +.PHONY: install-carthage +install-carthage: + mint run carthage carthage bootstrap --platform iOS --cache-builds + +.PHONY: generate-xcodeproj +generate-xcodeproj: + mint run xcodegen xcodegen generate + $(MAKE) install-cocoapods + +.PHONY: build-debug +build-debug: + set -o pipefail \ +&& xcodebuild \ +-sdk ${TEST_SDK} \ +-configuration ${TEST_CONFIGURATION} \ +-workspace ${WORKSPACE_NAME} \ +-scheme ${SCHEME_NAME} \ +build \ +| bundle exec xcpretty + +.PHONY: test +test: + set -o pipefail \ +&& xcodebuild \ +-sdk ${TEST_SDK} \ +-configuration ${TEST_CONFIGURATION} \ +-workspace ${WORKSPACE_NAME} \ +-scheme ${SCHEME_NAME} \ +-destination ${TEST_DESTINATION} \ +-skip-testing:${UI_TESTS_TARGET_NAME} \ +clean test \ +| bundle exec xcpretty --report html + From c9276446e0222a3f0e10b918308161002ff9be20 Mon Sep 17 00:00:00 2001 From: uhooi Date: Sat, 29 Aug 2020 17:34:52 +0900 Subject: [PATCH 2/5] Add main.yml --- .github/workflows/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e69de29 From 07862d4cae6030eb7b44aaad8635b9080e9be982 Mon Sep 17 00:00:00 2001 From: uhooi Date: Sat, 29 Aug 2020 17:49:16 +0900 Subject: [PATCH 3/5] Update main.yml --- .github/workflows/main.yml | 93 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e69de29..cc41d2d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -0,0 +1,93 @@ +name: CI + +on: + push: + branches: + - main + - develop + path-ignore: + - Docs/** + - README.md + pull_request: + branches: + - develop + path-ignore: + - Docs/** + - README.md + +env: + DEVELOPER_DIR: /Applications/Xcode_11.6.app/Contents/Developer + +jobs: + test: + runs-on: macOS-latest + env: + MINT_PATH: mint/lib + MINT_LINK_PATH: mint/bin + + steps: + # チェックアウト + - uses: actions/checkout@v2 + + # Bundlerで管理しているライブラリのキャッシュ + - name: Cache Gems + uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + # Bundlerで管理しているライブラリのインストール + - name: Install Bundled Gems + run: make install-bundler + + # Mintのインストール + - name: Install Mint + run: brew install mint + + # Mintで管理しているライブラリのキャッシュ + - name: Cache Mint packages + uses: actions/cache@v2 + with: + path: mint + key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} + restore-keys: | + ${{ runner.os }}-mint- + + # Carthageで管理しているライブラリのキャッシュ + - name: Cache Carthage packages + uses: actions/cache@v2 + with: + path: Carthage + key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }} + restore-keys: | + ${{ runner.os }}-carthage- + + # Carthageで管理しているライブラリのインストール + - name: Install Carthage frameworks + run: make install-carthage + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # CocoaPodsで管理しているライブラリのキャッシュ + - name: Cache Pods + uses: actions/cache@v2 + with: + path: Pods + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + + # プロジェクトファイルの生成、CocoaPodsで管理しているライブラリのインストール + - name: Generate Xcode project and install Pods + run: make generate-xcodeproj + + # ビルド + - name: Xcode build + run: make build-debug + + # 単体テストの実行 + - name: Xcode test + run: make test + From e5cc047d6e017b736b6653a996d4aa177be579ee Mon Sep 17 00:00:00 2001 From: uhooi Date: Sat, 29 Aug 2020 17:55:50 +0900 Subject: [PATCH 4/5] Add swiftlint.yml --- .github/workflows/swiftlint.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/swiftlint.yml diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 0000000..a06078c --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,19 @@ +name: SwiftLint + +on: + pull_request: + branches: + - develop + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.1.0 + From 745dd8077ec578a305933e3f14a1d86676fc93f7 Mon Sep 17 00:00:00 2001 From: Tkng Date: Tue, 27 Jul 2021 13:35:57 +0900 Subject: [PATCH 5/5] update main.yml updated syntax `path-ignore` to `paths-ignore` --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc41d2d..0554250 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,13 +5,13 @@ on: branches: - main - develop - path-ignore: + paths-ignore: - Docs/** - README.md pull_request: branches: - develop - path-ignore: + paths-ignore: - Docs/** - README.md