-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (127 loc) · 5 KB
/
ci.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
---
name: CI
on: [pull_request]
env:
token: ${{ secrets.MACOS_CI_SETUP_TOKEN }}
vm_name: sequoia-for-pillarbox
vm_image: ghcr.io/cirruslabs/macos-sequoia-xcode:latest
branch_name: ${{ github.head_ref }}
repo_url: |
https://${{ secrets.MACOS_CI_SETUP_TOKEN }}\
@github.com/${{ github.repository }}.git
jobs:
install-tools:
runs-on:
labels: [tart, macos]
outputs:
runner_group_label:
${{ steps.runner-group-label.outputs.runner_group_label }}
steps:
- name: Clone macos-ci-setup repository
run: |
rm -rf ../macos-ci-setup
git clone -b add-scripts \
https://${{ env.token }}\
@github.com/SRGSSR/macos-ci-setup.git ../macos-ci-setup
- name: Runner labels
id: runner-group-label
run: |
runner_group_label=\
$(../macos-ci-setup/runner-group-label.sh $RUNNER_NAME)
echo "runner_group_label=$runner_group_label" >> $GITHUB_OUTPUT
- name: Install tools
run: |
./.github/workflows/scripts/install-tools.sh \
${{ env.vm_name }} ${{ env.vm_image }} \
${{ env.branch_name }} ${{ env.repo_url }}
run-streams:
needs: install-tools
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Run test streams
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && make test-streams-start"
setup-project:
needs: install-tools
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Setup project
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && rm -rf Configuration"
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && Scripts/checkout-configuration.sh \
https://${{ env.token }}\
@github.com/SRGSSR/pillarbox-apple-configuration.git \
certificate HEAD Configuration"
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"security unlock-keychain -p 'admin' \
~/Library/Keychains/login.keychain-db && \
security import ~/_repo/Configuration/6YXTQTG8JJ_development.p12 \
-k ~/Library/Keychains/login.keychain-db \
-P '6YXTQTG8JJ' -T /usr/bin/security -T /usr/bin/codesign"
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"security set-key-partition-list -S apple-tool:,apple: -s -k 'admin' \
~/Library/Keychains/login.keychain-db"
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && make setup"
check-quality:
needs: [install-tools, setup-project]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Run the quality check
run: |
../macos-ci-setup/run-vm-shell-command.sh \
${{ env.vm_name }} "cd ~/_repo && make check-quality"
resolve-spm-dependencies:
needs: [install-tools, run-streams, setup-project]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Resolve SPM dependencies
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && xcodebuild -resolvePackageDependencies -verbose"
test-ios:
needs: [install-tools, resolve-spm-dependencies]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Run the iOS tests
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && make test-ios"
test-tvos:
needs: [install-tools, resolve-spm-dependencies]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Run the tvOS tests
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && make test-tvos"
archive-demo-ios:
needs: [install-tools, test-ios, test-tvos]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Archive the iOS demo
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && security unlock-keychain -p 'admin' \
~/Library/Keychains/login.keychain-db && make archive-demo-ios"
archive-demo-tvos:
needs: [install-tools, test-ios, test-tvos]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Archive the tvOS demo
run: |
../macos-ci-setup/run-vm-shell-command.sh ${{ env.vm_name }} \
"cd ~/_repo && security unlock-keychain -p 'admin' \
~/Library/Keychains/login.keychain-db && make archive-demo-tvos"
clean:
needs: [install-tools, archive-demo-ios, archive-demo-tvos]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
if: always()
steps:
- name: Stop and remove the VM
run: |
tart stop ${{ env.vm_name }}
tart delete ${{ env.vm_name }}