-
Notifications
You must be signed in to change notification settings - Fork 810
58 lines (50 loc) · 1.76 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
name: Build Status
# Step 1: Build on pull-requests or pushes to main
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# Step 2: Build the samples
build:
name: Build
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
include:
- { regex: "Objective-C/advanced", xcode_version: "15.3" }
- { regex: "Swift/advanced", xcode_version: "16.0" }
- { regex: "Objective-C/admob", xcode_version: "15.3" }
- { regex: "Swift/admob", xcode_version: "16.0" }
- { regex: "Objective-C/admanager", xcode_version: "15.3" }
- { regex: "Swift/admanager", xcode_version: "16.0" }
steps:
- name: Clone Repo
uses: actions/checkout@v1
- name:
# Available Xcode versions:
# https://github.com/actions/runner-images/blob/main/images/macos/toolsets/toolset-14.json
run: |
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer
echo "Selected Xcode version:"
/usr/bin/xcodebuild -version
- name: Pod repo update
run: pod repo update
- name: Install xcpretty
run: sudo gem install xcpretty
- name: Set commit range (push to the main branch, e.g. merge)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: echo "COMMIT_RANGE="${{ github.event.before }}.."" >> $GITHUB_ENV
- name: Set commit range (pull request)
if: github.event_name == 'pull_request'
run: echo "COMMIT_RANGE="HEAD~.."" >> $GITHUB_ENV
- name: Build
run: .github/workflows/build/build.sh
shell: bash
env:
COMMIT_RANGE: ${{ env.COMMIT_RANGE }}
REGEX: ${{ matrix.regex }}