27
27
- name : Setup workdir on Linux
28
28
if : ${{ runner.os == 'Linux' }}
29
29
run : |
30
- sudo mkdir /t \
31
- && sudo chown $(id -u):$(id -g) /t
30
+ sudo ln -sf $GITHUB_WORKSPACE /t
32
31
echo "TC_WORKDIR=/t" >> $GITHUB_ENV
33
32
34
33
- name : Setup workdir everywhere else
86
85
87
86
- name : Clone toolchains repo
88
87
uses : actions/checkout@v4
89
- with :
90
- path : ${{ env.TC_WORKDIR }}
91
88
92
89
- name : Prerequisites (Linux)
93
90
if : ${{ runner.os == 'Linux' }}
@@ -114,24 +111,20 @@ jobs:
114
111
uses : actions/download-artifact@v4
115
112
with :
116
113
name : tarballs.tar
117
- path : ${{ env.TC_WORKDIR }}
118
114
119
115
- name : Extract source tarballs
120
116
run : |
121
- cd $TC_WORKDIR
122
117
tar xf tarballs.tar
123
118
124
119
- name : Download bootstrap toolchain
125
120
if : ${{ inputs.fetch_bootstrap && runner.os == 'Linux' }}
126
121
uses : actions/download-artifact@v4
127
122
with :
128
123
name : toolchain-host_${{ inputs.crosstool_host_os }}-target_${{ inputs.crosstool_host_os }}_qmk_bootstrap
129
- path : ${{ env.TC_WORKDIR }}
130
124
131
125
- name : Extract bootstrap toolchain
132
126
if : ${{ inputs.fetch_bootstrap && runner.os == 'Linux' }}
133
127
run : |
134
- cd $TC_WORKDIR
135
128
mkdir -p toolchains
136
129
tar xf qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.crosstool_host_os }}_qmk_bootstrap.tar.xz -C toolchains
137
130
rm qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.crosstool_host_os }}_qmk_bootstrap.tar.xz
@@ -141,12 +134,10 @@ jobs:
141
134
uses : actions/download-artifact@v4
142
135
with :
143
136
name : toolchain-host_${{ inputs.crosstool_host_os }}-target_${{ inputs.build_host }}
144
- path : ${{ env.TC_WORKDIR }}
145
137
146
138
- name : Extract canadian host toolchain
147
139
if : ${{ inputs.canadian_build }}
148
140
run : |
149
- cd $TC_WORKDIR
150
141
mkdir -p toolchains
151
142
tar xf qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.build_host }}.tar.xz -C toolchains
152
143
rm qmk_toolchain*host_${{ inputs.crosstool_host_os }}-target_${{ inputs.build_host }}.tar.xz
@@ -156,20 +147,17 @@ jobs:
156
147
uses : actions/download-artifact@v4
157
148
with :
158
149
name : state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}
159
- path : ${{ env.TC_WORKDIR }}
160
150
161
151
- name : Extract build state
162
152
if : ${{ inputs.restore_state }}
163
153
run : |
164
- cd $TC_WORKDIR
165
154
# Ensure tarballs are extracted before we restore state as we've deleted $CT_COMMON_SRC_DIR before saving the state tarball
166
155
./${{ inputs.build_script }} +companion_tools_for_build
167
156
# Extract the state tarball
168
157
tar xf state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar
169
158
170
159
- name : Build toolchain
171
160
run : |
172
- cd $TC_WORKDIR
173
161
if [ "$RUNNER_OS" == "macOS" ]; then
174
162
export PATH="$PATH:/usr/local/opt/binutils/bin:/usr/local/opt/coreutils/bin:/usr/local/opt/libtool/libexec/gnubin"
175
163
export CPPFLAGS="-I/usr/local/opt/ncurses/include -I/usr/local/opt/gettext/include"
@@ -181,6 +169,7 @@ jobs:
181
169
export MACOSX_DEPLOYMENT_TARGET=12.0
182
170
fi
183
171
# Kick off the requested build phase
172
+ cd $TC_WORKDIR
184
173
./${{ inputs.build_script }} ${{ inputs.crosstool_args }}
185
174
186
175
- name : Upload build logs
@@ -189,12 +178,11 @@ jobs:
189
178
with :
190
179
name : build.log-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}-phase${{ inputs.phase_number }}
191
180
path : |
192
- ${{ env.TC_WORKDIR }}/ **/*.log
181
+ **/*.log
193
182
194
183
- name : Make build state
195
184
if : ${{ inputs.save_state }}
196
185
run : |
197
- cd $TC_WORKDIR
198
186
# We're saving state so we can resume at each step -- some of the internal build directories can be blown away as restarting from a step will recreate them.
199
187
if [ "$RUNNER_OS" == "macOS" ]; then
200
188
export PATH="$PATH:/usr/local/opt/coreutils/bin"
@@ -210,13 +198,12 @@ jobs:
210
198
uses : actions/upload-artifact@v4
211
199
with :
212
200
name : state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}
213
- path : ${{ env.TC_WORKDIR }}/ state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar
201
+ path : state-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar
214
202
overwrite : true
215
203
216
204
- name : Make toolchain tarball
217
205
if : ${{ inputs.toolchain_tarball }}
218
206
run : |
219
- cd $TC_WORKDIR
220
207
if [ "$RUNNER_OS" == "macOS" ]; then
221
208
export PATH="$PATH:/usr/local/opt/coreutils/bin"
222
209
export STAT="gstat"
@@ -237,7 +224,7 @@ jobs:
237
224
with :
238
225
name : toolchain-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}
239
226
path : |
240
- ${{ env.TC_WORKDIR }}/ qmk_toolchain-gcc*-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar.xz
227
+ qmk_toolchain-gcc*-host_${{ inputs.build_host }}-target_${{ inputs.target_host }}${{ inputs.toolchain_suffix }}.tar.xz
241
228
242
229
- name : Unmount case-sensitive workspace volume for macOS
243
230
if : always()
0 commit comments