-
Notifications
You must be signed in to change notification settings - Fork 16
86 lines (65 loc) · 2.57 KB
/
build_pr.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
name: Build Pull Request
on:
pull_request:
branches:
- '!main'
jobs:
test_macos:
name: "🤖 Test macOS"
runs-on: macos-13
env:
XCODE_VERSION: 14.3.1
concurrency:
group: test_macos13_darwin_$SCHEME_${{ github.ref }}
cancel-in-progress: true
steps:
- name: "🧑💻 Checkout repository"
uses: actions/checkout@v3
- name: "⚙️ Use Xcode ${{ env.XCODE_VERSION }}"
run: sudo xcode-select -switch /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: "🧰 Prepare tools"
run: |
Scripts/prepare_build_tools
- name: "🧪 xcodebuild clean test"
run: |
set -o pipefail && xcodebuild -resolvePackageDependencies | xcbeautify && xcodebuild clean test -project PactSwift.xcodeproj -scheme "PactSwift-macOS" -destination "arch=x86_64" | xcbeautify
- name: "⚗️ swift test"
run: |
set -o pipefail && swift test -c release
test_ios:
name: "🤖 Test iOS"
runs-on: macos-13
needs: [test_macos]
env:
SCHEME: "PactSwift-iOS"
DESTINATION: "platform=iOS Simulator,name=iPhone 14 Pro"
XCODE_VERSION: 14.3.1
concurrency:
group: test_macos13_ios_$SCHEME_${{ github.ref }}
cancel-in-progress: true
steps:
- name: "🧑💻 Checkout repository"
uses: actions/checkout@v3
- name: "⚙️ Use Xcode ${{ env.XCODE_VERSION }}"
run: sudo xcode-select -switch /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: "🧰 Prepare tools"
run: |
Scripts/prepare_build_tools
- name: "♘ Test for Carthage"
run: |
set -o pipefail && carthage build --no-skip-current --use-xcframeworks
- name: "🧪 xcodebuild clean test"
run: |
set -o pipefail && xcodebuild -resolvePackageDependencies | xcbeautify && xcodebuild clean test -project PactSwift.xcodeproj -scheme "PactSwift-iOS" -destination "platform=iOS Simulator,name=iPhone 14 Pro" | xcbeautify
- name: "⚗️ swift test"
run: |
swift test -c release
after_success:
needs: [test_ios]
name: "🚚 Build demo projects"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: "🚚 Build demo projects"
run: |
curl -X POST https://api.github.com/repos/surpher/pact-swift-examples/dispatches -H 'Accept: application/vnd.github.everest-preview+json' -u ${{ secrets.PACT_SWIFT_TOKEN }} --data '{"event_type":"PactSwift - ${{ github.event.head_commit.message }}"}'