forked from tuist/tuist
-
Notifications
You must be signed in to change notification settings - Fork 1
225 lines (214 loc) · 7.38 KB
/
tuist.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: Tuist
on:
push:
branches:
- main
pull_request:
paths:
- Tuist/**
- Package.resolved
- Gemfile*
- Package.swift
- Project.swift
- Sources/**
- '!Sources/**/*.docc'
- Templates/**
- Tests/**
- features/**
- fixtures/**
- .package.resolved
- .github/workflows/tuist.yml
concurrency:
group: tuist-${{ github.head_ref }}
cancel-in-progress: true
env:
RUBY_VERSION: '3.0.3'
TUIST_STATS_OPT_OUT: true
NODE_VERSION: 16.17.0
TUIST_CONFIG_CLOUD_TOKEN: ${{ secrets.TUIST_CONFIG_CLOUD_TOKEN }}
jobs:
release_build:
name: Release build with Xcode
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: 'Cache Tuist .build folder'
with:
path: .build
key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }}
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1
- name: Select Xcode for Tuist and Tuistenv
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- name: Build Tuist for release
run: swift build -c release --product tuist
- name: Build Tuistenv for release
run: swift build -c release --product tuistenv
- name: Build ProjectDescription for release
run: swift build -c release --product ProjectDescription
test:
name: Test with Xcode
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: asdf-vm/actions/install@v2
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: actions/cache@v3
name: 'Cache fetched dependencies folder'
with:
path: Tuist/Dependencies/SwiftPackageManager/.build
key: spm-v1-${{ hashFiles('Package.resolved') }}
restore-keys: spm-v1-${{ hashFiles('Package.resolved') }}
- name: Fetch dependencies
run: tuist fetch
- name: Test
run: tuist test --no-cache --skip-test-targets TuistBuildAcceptanceTests TuistGenerateOneAcceptanceTests TuistTestAcceptanceTests
cache-warm:
name: Cache warm with latest Tuist
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: actions/cache@v3
name: 'Cache fetched dependencies folder'
with:
path: Tuist/Dependencies/SwiftPackageManager/.build
key: spm-v1-${{ hashFiles('Package.resolved') }}
restore-keys: spm-v1-${{ hashFiles('Package.resolved') }}
- name: Fetch dependencies
run: tuist fetch
- name: Print hashes
run: tuist cache print-hashes
- name: Cache warm
run: tuist cache warm
cache-warm-silicon:
name: Cache warm with latest Tuist on Silicon
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: actions/cache@v3
name: 'Cache fetched dependencies folder'
with:
path: Tuist/Dependencies/SwiftPackageManager/.build
key: spm-v1-${{ hashFiles('Package.resolved') }}
restore-keys: spm-v1-${{ hashFiles('Package.resolved') }}
- name: Fetch dependencies
run: tuist fetch
- name: Print hashes
run: tuist cache print-hashes
- name: Cache warm
run: tuist cache warm
acceptance_tests:
name: ${{ matrix.feature }} acceptance tests with Tuist
runs-on: macos-13
env:
TUIST_CONFIG_CLOUD_TOKEN: ${{ secrets.TUIST_CONFIG_CLOUD_TOKEN }}
strategy:
matrix:
feature:
[
'Build',
'GenerateOne',
'Test',
]
steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v2
- name: Select Xcode
# Xcode accepts -skipMacroValidation
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- name: Skip Xcode Macro Fingerprint Validation
run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- uses: actions/cache@v3
name: 'Cache fetched dependencies folder'
with:
path: Tuist/Dependencies/SwiftPackageManager/.build
key: spm-v1-${{ hashFiles('Tuist/Package.resolved') }}
restore-keys: spm-v1-${{ hashFiles('Tuist/Package.resolved') }}
- name: Fetch dependencies
run: tuist fetch
- name: Run acceptance tests
run: tuist test Tuist${{ matrix.feature }}AcceptanceTests
cucumber_acceptance_tests:
name: ${{ matrix.feature }} acceptance tests with Xcode
runs-on: macos-13
strategy:
matrix:
feature:
[
'dependencies',
'edit',
'generate-3',
'generate-4',
'generate-5',
'generate-6',
'generate-7',
'generate-8',
'graph',
'init',
'list-targets',
'plugins',
'precompiled',
'run',
'scaffold',
'tasks',
'plugin',
]
needs: release_build
steps:
- uses: actions/checkout@v3
- name: Initialize submodules
run: |
git submodule update --init fixtures/tuist_plugin
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: actions/cache@v3
name: 'Cache Tuist .build folder'
with:
path: .build
key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1-${{ hashFiles('Package.resolved') }}
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ env.RUBY_VERSION }}-gems-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.RUBY_VERSION }}-gems-
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run cucumber tests
run: FEATURE=features/${{ matrix.feature }}.feature make tuist/acceptance-test
lint:
name: Lint
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- name: Run
run: make workspace/lint
lint-lockfiles:
name: Lint lockfiles
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Run
run: ./make/tasks/workspace/lint/lockfiles.sh