-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (113 loc) · 3.79 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
---
name: CI
on: [pull_request]
env:
token: ${{ secrets.PILLARBOX_CI_CD_TOKEN }}
vm_name: sequoia-for-pillarbox
vm_image: ghcr.io/cirruslabs/macos-sequoia-xcode:latest
branch_name: ${{ github.head_ref }}
scripts_path: "/tmp/.$vm_name/macos-ci-setup"
ci_scripts_path: "${{ github.workspace }}/.github/workflows/scripts"
repo_url:
"https://${{ secrets.PILLARBOX_CI_CD_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: Checkout code
uses: actions/checkout@v4
- name: Clone macos-ci-setup repository
run: |
${{ env.ci_scripts_path }}/clone-macos-ci-setup.sh \
${{ env.scripts_path }} ${{ env.token }} "add-scripts"
- name: Get runner group by runner name
id: runner-group-label
run: |
${{ env.ci_scripts_path }}/get-runner-group.sh \
${{ env.scripts_path }} \
$RUNNER_NAME $GITHUB_OUTPUT
- name: Install tools
run: |
${{ env.ci_scripts_path }}/install-tools.sh \
${{ env.scripts_path }} \
${{ 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: Checkout code
uses: actions/checkout@v4
- name: Run test streams
run: |
${{ env.ci_scripts_path }}/vm-run-test-streams.sh \
${{ env.scripts_path }} ${{ env.vm_name }}
setup-project:
needs: install-tools
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup project
run: |
${{ env.ci_scripts_path }}/setup-project.sh \
${{ env.scripts_path }} ${{ env.vm_name }} ${{ env.token }}
check-quality:
needs: [install-tools, setup-project]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run the quality check
run: |
${{ env.ci_scripts_path }}/vm-check-quality.sh \
${{ env.scripts_path }} ${{ env.vm_name }}
resolve-spm-dependencies:
needs: [install-tools, run-streams, setup-project]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Resolve SPM dependencies
run: |
${{ env.ci_scripts_path }}/vm-resolve-spm-dependencies.sh \
${{ env.scripts_path }} ${{ env.vm_name }}
tests:
needs: [install-tools, resolve-spm-dependencies]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
strategy:
matrix:
platform: [ios, tvos]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run tests
run: |
${{ env.ci_scripts_path }}/vm-test.sh \
${{ env.scripts_path }} ${{ env.vm_name }} ${{ matrix.platform }}
archive-demos:
needs: [install-tools, tests]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
strategy:
matrix:
platform: [ios, tvos]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Archive the demo
run: |
${{ env.ci_scripts_path }}/vm-archive.sh \
${{ env.scripts_path }} ${{ env.vm_name }} ${{ matrix.platform }}
stop:
needs: [install-tools, archive-demos]
runs-on: ${{ needs.install-tools.outputs.runner_group_label }}
if: always()
steps:
- name: Stop the VM
run: |
tart stop ${{ env.vm_name }}