forked from tuist/tuist
-
Notifications
You must be signed in to change notification settings - Fork 0
199 lines (192 loc) · 6.35 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
name: Tuist
on:
push:
branches:
- main
pull_request:
paths:
- Tuist/**
- Package.resolved
- Gemfile*
- Package.swift
- Project.swift
- Sources/**
- Templates/**
- Tests/**
- projects/tuist/features/**
- projects/tuist/fixtures/**
- .github/workflows/tuist.yml
- .package.resolved
- projects/fourier/**
concurrency:
group: tuist-${{ github.head_ref }}
cancel-in-progress: true
env:
RUBY_VERSION: '3.0.3'
TUIST_STATS_OPT_OUT: true
jobs:
unit_tests:
name: Unit tests with Xcode
runs-on: macOS-12
steps:
- uses: actions/checkout@v1
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: actions/cache@v2
name: 'Cache Tuist .build folder'
with:
path: .build
key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-${{ hashFiles('Package.resolved') }}
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v2
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 tests
run: |
./fourier test tuist unit
release_build:
name: Release build with Xcode
runs-on: macOS-12
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v2
name: 'Cache Tuist .build folder'
with:
path: .build
key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-${{ hashFiles('Package.resolved') }}
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm
- 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
acceptance_tests:
name: ${{ matrix.feature }} acceptance tests with Xcode
runs-on: macOS-12
strategy:
matrix:
feature:
[
'build',
'cache-frameworks',
'cache-xcframeworks',
'dependencies',
'docc',
'edit',
'env',
'generate-1',
'generate-2',
'generate-3',
'generate-4',
'generate-5',
'generate-6',
'generate-7',
'generate-8',
'graph',
'init',
'list-targets',
'plugins',
'precompiled',
'run',
'scaffold',
'tasks',
'test',
'plugin',
]
env:
TUIST_CONFIG_GITHUB_API_TOKEN: ${{ secrets.GH_TOKEN }}
needs: release_build
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: actions/cache@v2
name: 'Cache Tuist .build folder'
with:
path: .build
key: ${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-${{ hashFiles('Package.resolved') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm-${{ hashFiles('Package.resolved') }}
${{ runner.os }}-${{ hashFiles('.xcode-version') }}-spm
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v2
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 tests
run: ./fourier test tuist acceptance projects/tuist/features/${{ matrix.feature }}.feature
lint:
name: Lint
runs-on: macOS-12
steps:
- uses: actions/checkout@v1
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ env.RUBY_VERSION }}${{ 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: Install Bundler dependencies
run: bundle install
- name: Run
run: ./fourier lint tuist
lint-lockfiles:
name: Lint lockfiles
runs-on: macOS-12
steps:
- uses: actions/checkout@v1
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_$(cat .xcode-version).app
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ env.RUBY_VERSION }}${{ 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: Install Bundler dependencies
run: bundle install
- name: Run
run: ./fourier lint lockfiles