Skip to content

Commit

Permalink
Merge pull request #357 from uhooi/release/1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
uhooi authored Dec 13, 2022
2 parents cf7dc08 + 2a79f5c commit 3ca8a15
Show file tree
Hide file tree
Showing 317 changed files with 6,988 additions and 3,038 deletions.
30 changes: 30 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Issue

- close #TBD

## Overview

TBD

## Details (Optional)

TBD

## Screenshots (Optional)

|Before|After|
|:--:|:--:|
|TBD|TBD|

## Checklist

- [ ] Format code with SwiftLint (<kbd>⌘B</kbd> in Xcode)
- [ ] Resolve Xcode warning

## What to check (Optional)

- [ ] TBD

## Reference(s) (Optional)

- https://example.com
264 changes: 77 additions & 187 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,244 +8,134 @@ on:
paths-ignore:
- Docs/**
- README.md
- README.ja.md
- LICENSE
- Rambafile
pull_request:
branches:
# - !main
- develop
paths-ignore:
- Docs/**
- README.md
- README.ja.md
- LICENSE
- Rambafile
workflow_dispatch:

permissions:
contents: read

env:
DEVELOPER_DIR: /Applications/Xcode_13.0.app
DEVELOPER_DIR: /Applications/Xcode_14.1.app

jobs:
build:
runs-on: macos-11
name: build for ${{ matrix.environment }}
runs-on: macos-12
strategy:
fail-fast: false
matrix:
environment: ["develop", "production"]

steps:
# チェックアウト
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# 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

# SwiftPMで管理しているCLIツールのキャッシュ
- name: Cache CLI tools managed by SwiftPM
uses: actions/cache@v2
id: cli-tools-cache
with:
path: Tools/UhooiPicBookTools/.build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Tools/UhooiPicBookTools/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# SwiftPMで管理しているCLIツールのビルド
- name: Build CLI tools managed by SwiftPM
if: steps.cli-tools-cache.outputs.cache-hit != 'true'
run: make build-cli-tools

# Mockoloのキャッシュ
- name: Cache Mockolo
uses: actions/cache@v2
id: mockolo-cache
with:
path: Tools/UhooiPicBookMockolo/.build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Tools/UhooiPicBookMockolo/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# Mockoloのビルド
- name: Build Mockolo
if: steps.mockolo-cache.outputs.cache-hit != 'true'
run: make build-mockolo

# Firebase SDKのダウンロード
- name: Download Firebase SDK
run: make download-firebase-sdk

# ライセンス情報の生成
- name: Generate licenses
run: make generate-licenses

# プロジェクトファイルの生成
- name: Generate Xcode project for develop
run: make generate-xcodeproj-develop

# SwiftPMで管理しているライブラリのキャッシュ
- name: Cache libraries managed by SwiftPM
uses: actions/cache@v2
with:
path: SourcePackages
key: ${{ runner.os }}-swiftpm-${{ hashFiles('**/UhooiPicBook.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: |
${{ runner.os }}-swiftpm-
# セットアップ
- uses: ./.github/workflows/templates/setup-ios

# ビルド
- name: Xcode build
run: make build-debug
- name: Xcode build for ${{ matrix.environment }}
run: |
make build-debug-${{ matrix.environment }}
# ビルドログのアップロード
- name: Upload build log Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: xcodebuild-logs
path: xcodebuild_build.log
path: |
Reports/*_Build.log
if-no-files-found: ignore
retention-days: 14

test:
runs-on: macos-11
name: test for ${{ matrix.name }}
runs-on: macos-12
strategy:
fail-fast: false
matrix:
name: ["develop", "production", "app-module"]

steps:
# チェックアウト
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# 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

# SwiftPMで管理しているCLIツールのキャッシュ
- name: Cache CLI tools managed by SwiftPM
uses: actions/cache@v2
id: cli-tools-cache
with:
path: Tools/UhooiPicBookTools/.build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Tools/UhooiPicBookTools/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# SwiftPMで管理しているCLIツールのビルド
- name: Build CLI tools managed by SwiftPM
if: steps.cli-tools-cache.outputs.cache-hit != 'true'
run: make build-cli-tools

# Mockoloのキャッシュ
- name: Cache Mockolo
uses: actions/cache@v2
id: mockolo-cache
with:
path: Tools/UhooiPicBookMockolo/.build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Tools/UhooiPicBookMockolo/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# Mockoloのビルド
- name: Build Mockolo
if: steps.mockolo-cache.outputs.cache-hit != 'true'
run: make build-mockolo

# Firebase SDKのダウンロード
- name: Download Firebase SDK
run: make download-firebase-sdk

# ライセンス情報の生成
- name: Generate licenses
run: make generate-licenses

# プロジェクトファイルの生成
- name: Generate Xcode project for develop
run: make generate-xcodeproj-develop

# SwiftPMで管理しているライブラリのキャッシュ
- name: Cache libraries managed by SwiftPM
uses: actions/cache@v2
with:
path: SourcePackages
key: ${{ runner.os }}-swiftpm-${{ hashFiles('**/UhooiPicBook.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: |
${{ runner.os }}-swiftpm-
# セットアップ
- uses: ./.github/workflows/templates/setup-ios

# モックの生成
- name: Generate mocks with Mockolo
run: make generate-mocks

# 単体テストの実行
- name: Xcode test
run: make test
run: |
make test-debug-${{ matrix.name }}
# テスト結果のアップロード
- name: Upload test results Artifact
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results
path: |
Reports/*.xcresult
if-no-files-found: error
retention-days: 14

# 単体テストログのアップロード
- name: Upload test log Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: xcodebuild-logs
path: xcodebuild_test.log
path: |
Reports/*_Test.log
if-no-files-found: ignore
retention-days: 14

# コードカバレッジをHTML形式で取得
- name: Get code coverage for HTML
run: make get-coverage-html
show-test-results:
runs-on: macos-12
permissions:
checks: write
needs: test

# コードカバレッジのアップロード
- name: Upload test results and code coverage Artifact
uses: actions/upload-artifact@v2
steps:
# チェックアウト
- uses: actions/checkout@v3

# テスト結果のダウンロード
- name: Download test results artifact
uses: actions/download-artifact@v3
with:
name: results
path: |
html_report/**/*
if-no-files-found: warn
retention-days: 14
name: test-results
path: Reports

# コードカバレッジをCobertura形式で取得
- name: Get code coverage for Cobertura
run: make get-coverage-cobertura
# テスト結果のマージ
- name: Merge test results
run: make merge-test-results

# コードカバレッジをCodecovへアップロード
- name: Upload code coverage to Codecov
run: make upload-coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# テスト結果の表示とアップロード
- uses: kishikawakatsumi/xcresulttool@v1
if: success() || failure()
with:
path: Reports/TestResults.xcresult

info:
runs-on: macos-11
runs-on: macos-12

steps:
# チェックアウト
- uses: actions/checkout@v2

# Xcodeの一覧出力
- name: Show Xcode list
run: ls /Applications | grep 'Xcode'

# Xcodeのバージョン出力
- name: Show Xcode version
run: xcodebuild -version

# Makeのバージョン出力
- name: Show Make version
run: make --version

# Rubyのバージョン出力
- name: Show Ruby version
run: ruby --version

# Bundlerのバージョン出力
- name: Show Bundler version
run: bundle version
- uses: actions/checkout@v3

# 端末の一覧出力
- name: Show devices
run: make show-devices
# 情報の出力
- uses: ./.github/workflows/templates/output-info

13 changes: 7 additions & 6 deletions .github/workflows/opened-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
types:
- opened

permissions:
issues: write

jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v2
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -23,11 +25,10 @@ jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v2
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.addLabels({
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
Loading

0 comments on commit 3ca8a15

Please sign in to comment.