-
Notifications
You must be signed in to change notification settings - Fork 118
137 lines (128 loc) · 4.38 KB
/
build.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
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
# Cancel any in-progress workflows for this workflow/branch combination.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
project: Source/OCMockito.xcodeproj
jobs:
build:
name: Build without tests
runs-on: macos-13
strategy:
matrix:
run-config:
- { scheme: 'OCMockito-iOS', sdk: 'iphonesimulator', destination: 'platform=iOS Simulator,OS=latest,name=iPhone 14' }
- { scheme: 'OCMockito-tvOS', sdk: 'appletvsimulator', destination: 'platform=tvOS Simulator,OS=latest,name=Apple TV' }
- { scheme: 'OCMockito-watchOS', sdk: 'watchsimulator', destination: 'platform=watchOS Simulator,OS=latest,name=Apple Watch Series 6 (44mm)' }
steps:
- name: Check out project
uses: actions/checkout@v4
- name: Set up Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '14.3'
- name: Show current version of Xcode
run: xcodebuild -version
- name: Get OCHamcrest
run: Frameworks/gethamcrest
- name: Build
run: xcodebuild build -project '${{ env.project }}' -scheme '${{ matrix.run-config['scheme'] }}' -sdk '${{ matrix.run-config['sdk'] }}' -destination '${{ matrix.run-config['destination'] }}' | xcpretty && exit ${PIPESTATUS[0]}
test:
name: Build, test, report coverage
runs-on: macos-13
env:
scheme: 'OCMockito'
sdk: 'macosx'
steps:
- name: Check out project
uses: actions/checkout@v4
- name: Set up Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '14.3'
- name: Show current version of Xcode
run: xcodebuild -version
- name: Get OCHamcrest
run: Frameworks/gethamcrest
- name: Build & test
run: xcodebuild test -project '${{ env.project }}' -scheme '${{ env.scheme }}' -sdk '${{ env.sdk }}' | xcpretty && exit ${PIPESTATUS[0]}
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set --local without 'documentation'
bundle install --jobs 4 --retry 3
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: get_branch
- name: Report coverage
run: bundle exec slather
env:
GIT_BRANCH: ${{ steps.get_branch.outputs.branch }}
CI_PULL_REQUEST: ${{ github.event.number }}
COVERAGE_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
buildSwiftPackage:
needs: [ build, test ]
name: Build Swift package
runs-on: macos-13
steps:
- name: Check out project
uses: actions/checkout@v4
- name: Set up Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '14.3'
- name: Build
run: cd Source; swift build -v
buildCarthage:
needs: [ build, test ]
name: Build Carthage
runs-on: macos-13
steps:
- name: Check out project
uses: actions/checkout@v4
- name: Set up Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: '14.3'
- name: Show current version of Xcode
run: xcodebuild -version
- name: Show current version of Carthage
run: carthage version
- name: Update dependencies
run: carthage update --use-xcframeworks
- name: Build
run: carthage build --configuration Release --no-skip-current --use-xcframeworks
podspec:
needs: [ build, test ]
name: Pod Spec Lint
runs-on: macos-13
steps:
- name: Check out project
uses: actions/checkout@v4
- name: Show current version of CocoaPods
run: pod --version
- name: Lint the pod spec
run: pod spec lint --quick
auto-merge:
needs: [ buildSwiftPackage, buildCarthage, podspec ]
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: auto-merge
if: |
github.actor == 'dependabot[bot]' &&
github.event_name == 'pull_request'
run: |
./merge_dependabot.sh
env:
PR_URL: ${{github.event.pull_request.html_url}}
# this secret needs to be in the settings.secrets.dependabot
GITHUB_TOKEN: ${{secrets.GH_ACTION_TOKEN}}