-
Notifications
You must be signed in to change notification settings - Fork 25
143 lines (119 loc) · 3.05 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI
on:
push:
branches:
- main
- develop
paths-ignore:
- Docs/**
- README.md
- README.ja.md
- LICENSE
pull_request:
paths-ignore:
- Docs/**
- README.md
- README.ja.md
- LICENSE
workflow_dispatch:
permissions:
contents: read
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app
MINT_PATH: .mint/lib
MINT_LINK_PATH: .mint/bin
jobs:
build:
name: build for ${{ matrix.environment }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
environment: ["develop", "production"]
steps:
# チェックアウト
- uses: actions/checkout@v3
# セットアップ
- uses: ./.github/workflows/templates/setup-ios
# ビルド
- name: Xcode build for ${{ matrix.environment }}
run: |
make build-debug-${{ matrix.environment }}
# ビルドログのアップロード
- name: Upload build log Artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: xcodebuild-logs
path: |
Reports/*_Build.log
if-no-files-found: ignore
retention-days: 14
test:
name: test for ${{ matrix.name }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
name: ["develop", "production", "app-module"]
steps:
# チェックアウト
- uses: actions/checkout@v3
# セットアップ
- uses: ./.github/workflows/templates/setup-ios
# モックの生成
- name: Generate mocks with Mockolo
run: make generate-mocks
# 単体テストの実行
- name: Xcode 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@v3
if: failure()
with:
name: xcodebuild-logs
path: |
Reports/*_Test.log
if-no-files-found: ignore
retention-days: 14
show-test-results:
runs-on: macos-14
permissions:
checks: write
needs: test
steps:
# チェックアウト
- uses: actions/checkout@v3
# テスト結果のダウンロード
- name: Download test results artifact
uses: actions/download-artifact@v3
with:
name: test-results
path: Reports
# テスト結果のマージ
- name: Merge test results
run: make merge-test-results
# テスト結果の表示とアップロード
- uses: kishikawakatsumi/xcresulttool@v1
if: success() || failure()
with:
path: Reports/TestResults.xcresult
info:
runs-on: macos-14
steps:
# チェックアウト
- uses: actions/checkout@v3
# 情報の出力
- uses: ./.github/workflows/templates/output-info