forked from surpher/PactSwiftMockServer
-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (137 loc) · 4.14 KB
/
build_test.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build and Test
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
- 'chore/**'
- 'docs/**'
- 'feat/**'
- 'feature/**'
- 'fix/**'
- 'refactor/**'
- 'releases/**'
- 'style/**'
- 'test/**'
- 'tech/**'
env:
RUST_TARGET_PATH: pact-reference/rust/target
BINARIES_PATH: Resources
jobs:
build:
name: "Build libpact_ffi binaries"
runs-on: macos-14-arm64
timeout-minutes: 60
strategy:
fail-fast: true
concurrency:
group: build-macos14-arm64-${{ github.ref }}
cancel-in-progress: true
steps:
- name: "♻️ Checkout repository"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "♼ Cache rust binaries"
uses: actions/cache@v3
with:
path: |
${{ env.RUST_TARGET_PATH }}
${{ env.BINARIES_PATH }}
key: build-${{ runner.os }}-rust-${{ hashFiles('**/libpact_ffi.version') }}
restore-keys: |
build-${{ runner.os }}-rust-
- name: "🔍 Check if binaries exist in ${{ env.BINARIES_PATH }}"
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "Resources/**/libpact_ffi.a"
- name: "🎁 Build binaries (if not cached)"
if: steps.check_files.outputs.files_exist == 'false'
run: |
Support/build_rust_dependencies
testMacOS14:
name: "Test macOS 14 arm64"
runs-on: macos-14-arm64
needs: [build]
concurrency:
group: test-${{ github.ref }}-${{ matrix.scheme }}
cancel-in-progress: true
strategy:
fail-fast: true
matrix:
include:
- scheme: "PactSwiftMockServer-iOS"
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
- scheme: "PactSwiftMockServer-macOS"
destination: "arch=arm64"
env:
SCHEME: ${{ matrix.scheme }}
DESTINATION: ${{ matrix.destination }}
steps:
- name: "♻️ Checkout repository"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "♼ Cache rust binaries"
uses: actions/cache@v3
with:
path: |
${{ env.RUST_TARGET_PATH }}
${{ env.BINARIES_PATH }}
key: build14-${{ runner.os }}-rust-${{ hashFiles('**/libpact_ffi.version') }}
restore-keys: |
build14-${{ runner.os }}-rust-
- name: "🏗 Use Xcode 15.3"
run: sudo xcode-select -switch /Applications/Xcode_15.3.app
- name: "🛠 Prepare Tools"
run: |
sh Support/prepare_build_tools
- name: "⚗️ Run tests (Xcode)"
run: |
sh Support/build_test
testMacOS13:
name: "Test macOS 13"
runs-on: macos-13
needs: [build]
strategy:
fail-fast: true
matrix:
include:
- scheme: "PactSwiftMockServer-iOS"
destination: "platform=iOS Simulator,name=iPhone 14 Pro"
- scheme: "PactSwiftMockServer-macOS"
destination: "arch=x86_64"
env:
SCHEME: ${{ matrix.scheme }}
DESTINATION: ${{ matrix.destination }}
concurrency:
group: test-${{ github.ref }}-${{ matrix.scheme }}
cancel-in-progress: true
steps:
- name: "♻️ Checkout repository"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "♼ Cache rust binaries"
uses: actions/cache@v3
with:
path: |
${{ env.RUST_TARGET_PATH }}
${{ env.BINARIES_PATH }}
key: build13-${{ runner.os }}-rust-${{ hashFiles('**/libpact_ffi.version') }}
restore-keys: |
build13-${{ runner.os }}-rust-
- name: "🏗 Use Xcode 15.2"
run: sudo xcode-select -switch /Applications/Xcode_15.2.app
- name: "🛠 Prepare Tools"
run: |
sh Support/prepare_build_tools
- name: "⚗️ Run tests (Xcode)"
run: |
sh Support/build_test
- name: "⬆️ Upload code coverage"
run: |
bash <(curl -s https://codecov.io/bash) -J 'PactSwiftMockServer'