-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (106 loc) · 4.2 KB
/
CI.yml
File metadata and controls
123 lines (106 loc) · 4.2 KB
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
name: CI-Test
on:
pull_request:
branches: [ Develop ]
#pull_request:
# branches: [ develop ]
# types: [ opened ]
jobs:
### develop env ci (build & unit test)
DEVELOP-CI:
#runs-on: macos-12.2.1
runs-on: macos-latest
#runs-on: ubuntu-latest
env:
TARGET_ENV: Debug
XCWORKSPACE: HelpMeChooseIOS.xcworkspace
#PROJECT: pineapp.xcodeproj
SCHEME: HelpMeChooseIOS
#CONFIGURATION: Debug
DESTINATION: platform=iOS Simulator,name=iPhone 13
#MATTERMOST_WEBHOOK_URL: https://mattermost.hwikx.com/hooks/cip4am3x4f885b7ayt4gu5ug1a
#MATTERMOST_WEBHOOK_CHANNEL: private_mattermost_chat_test
steps:
- uses: actions/checkout@v3
#- name: Send CI Start Message
# run: |
# curl -i -X POST ${{ env.MATTERMOST_WEBHOOK_URL }} \
# -H 'Content-Type: application/json' \
# --data '{"channel":"${{ env.MATTERMOST_WEBHOOK_CHANNEL }}","attachments":[{"color":"#00bfff","text":"##### [iOS CI Action Start]
# `Project Name` : ${{ github.repository }} (Run Number: ${{ github.run_number }})
# `Target Env` : ${{ env.TARGET_ENV }}
# `PR Number` : ${{ github.ref_name }}
# `Request Uername` : ${{ github.actor }}
# `Request Type` : ${{ github.event_name }}"}]}'
- name: Install Tuist
run: |
bash <(curl -Ls https://install.tuist.io)
- name: Generate project
run: |
tuist generate
- name: Check Xcode
run: ls -n /Applications/ | grep Xcode
#- name: Setup - Xcode
# run: sudo xcode-select -s /Applications/Xcode_13.0.app/Contents/Developer
#- name: Pod Update
# run: |
# pod update
# pod repo update
#- name: Pod Install
# run: pod install --repo-update --clean-install
- name: Build
run: |
xcodebuild clean test -workspace "$XCWORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION"
echo $?
#- name: Comment To PR (Success)
# uses: actions/github-script@v5.0.0
# with:
# github-token: ${{ github.token }}
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: 'Code test completed successfully!'
# })
- name: CI Finish Message (Success)
run: |
echo $?
# curl -i -X POST ${{ env.MATTERMOST_WEBHOOK_URL }} \
# -H 'Content-Type: application/json' \
# --data '{"channel":"${{ env.MATTERMOST_WEBHOOK_CHANNEL }}","attachments":[{"color":"#44ff00","text":"##### [iOS CI Action Success]
# `Project Name` : ${{ github.repository }} (Run Number: ${{ github.run_number }})
# `Target Env` : ${{ env.TARGET_ENV }}
# `PR Number` : ${{ github.ref_name }}
# `Request Uername` : ${{ github.actor }}
# `CI Result` : ${{ job.status }}"}]}'
### Only Comment to PR (Not Used)
##- if: failure()
## name: Comment To PR (Failed)
## uses: actions/github-script@v5.0.0
## with:
## github-token: ${{ github.token }}
## script: |
## github.rest.issues.createComment({
## issue_number: context.issue.number,
## owner: context.repo.owner,
## repo: context.repo.repo,
## body: 'Code test failed!! Check Again!! GitAction Number is [ ${{ github.run_number }} ]'
## })
- if: failure()
name: CI Finish Message (Failed)
run: |
# curl -i -X POST ${{ env.MATTERMOST_WEBHOOK_URL }} \
# -H 'Content-Type: application/json' \
# --data '{"channel":"${{ env.MATTERMOST_WEBHOOK_CHANNEL }}","attachments":[{"color":"#ff0000","text":"##### [iOS CI Action Failed]
# `Project Name` : ${{ github.repository }} (Run Number: ${{ github.run_number }})
# `Target Env` : ${{ env.TARGET_ENV }}
# `PR Number` : ${{ github.ref_name }}
# `Request Uername` : ${{ github.actor }}
# `CI Result` : ${{ job.status }}"}]}'
### Comment to PR and Close PR
#- if: failure()
# name: Comment To PR (Failed)
# uses: peter-evans/close-pull@v1.1.3
# with:
# comment: 'Code test failed!! Check Again!! GitAction Number is [ ${{ github.run_number }} ]'