File tree Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow will build a Swift project
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
3
+
4
+ name : Swift
5
+
6
+ on :
7
+ push :
8
+ branches : [ "main" ]
9
+ pull_request :
10
+ branches : [ "main" ]
11
+
12
+ jobs :
13
+ build :
14
+ runs-on : macos-latest
15
+
16
+ outputs :
17
+ STATUS : ${{ steps.set_status.outputs.STATUS }}
18
+
19
+ steps :
20
+ - run : echo "The job was automatically triggered by a ${{ github.event_name }} event."
21
+ - uses : actions/checkout@v3
22
+
23
+ - name : Build project and run tests
24
+ run : xcodebuild test -quiet -scheme MijickCalendarView -destination 'platform=iOS Simulator,name=iPhone 13 Pro' -resultBundlePath TestResults
25
+
26
+ - name : Set env STATUS
27
+ if : always()
28
+ id : set_status
29
+ run : |
30
+ if [[ ${{ job.status }} == 'success' ]]; then
31
+ echo "STATUS=success" >> $GITHUB_OUTPUT
32
+ else
33
+ echo "STATUS=failure" >> $GITHUB_OUTPUT
34
+ fi
35
+
36
+ slackNotification :
37
+ name : Slack Notification
38
+ needs : build
39
+ if : always()
40
+ runs-on : ubuntu-latest
41
+
42
+ steps :
43
+ - uses : actions/checkout@v2
44
+
45
+ - name : Set env ICON
46
+ run : |
47
+ if [[ ${{ needs.build.outputs.STATUS }} == 'success' ]]; then
48
+ echo "ICON=https://cdn-icons-png.flaticon.com/512/148/148767.png" >> $GITHUB_ENV
49
+ else
50
+ echo "ICON=https://cdn-icons-png.flaticon.com/512/4436/4436559.png" >> $GITHUB_ENV
51
+ fi
52
+
53
+ - name : Slack Notification
54
+ uses : rtCamp/action-slack-notify@v2
55
+ env :
56
+ SLACK_ICON : ${{ env.ICON }}
57
+ SLACK_COLOR : ${{ needs.build.outputs.STATUS }}
58
+ SLACK_TITLE : " Branch ${{ github.head_ref }}"
59
+ SLACK_MESSAGE : " Test status is ${{ needs.build.outputs.STATUS }}"
60
+ SLACK_WEBHOOK : " ${{ secrets.SLACK_INCOMMING_WEBHOOK }}"
Original file line number Diff line number Diff line change 1
- // swift-tools-version: 5.9
1
+ // swift-tools-version: 5.7
2
2
// The swift-tools-version declares the minimum version of Swift required to build this package.
3
3
4
4
import PackageDescription
You can’t perform that action at this time.
0 commit comments