@@ -68,11 +68,83 @@ jobs:
6868 with :
6969 lfs : " true"
7070
71- - name : Setup Xcode 16
71+ - name : Setup Rust & Cargo
72+ uses : ./.github/actions/setup_rust_cargo
73+
74+ - name : Build darwin target
75+ uses : ./.github/actions/build_cli_macos_target
7276 if : contains(matrix.platform.os-name, 'darwin')
73- uses : maxim-lobanov/setup-xcode@v1
7477 with :
75- xcode-version : 16
78+ target : ${{ matrix.platform.target }}
79+ profile : release
80+ force-sentry-dev : true
81+
82+ - name : Build unix/Windows target
83+ uses : ./.github/actions/build_cli_linux_windows_target
84+ if : ${{ !contains(matrix.platform.os-name, 'darwin') }}
85+ with :
86+ target : ${{ matrix.platform.target }}
87+ profile : release
88+ force-sentry-dev : true
89+
90+ - name : Upload built binary
91+ uses : actions/upload-artifact@v4
92+ if : always()
93+ with :
94+ name : binary-${{ matrix.platform.target }}
95+ path : target/${{ matrix.platform.target }}/release/trunk-analytics-cli*
96+ retention-days : 1
97+
98+ test :
99+ name : Test for ${{ matrix.platform.target }}
100+ needs : [build_release]
101+ strategy :
102+ matrix :
103+ platform :
104+ - os-name : linux-x86_64
105+ runs-on : ubuntu-latest
106+ target : x86_64-unknown-linux-musl
107+
108+ - os-name : linux-aarch64
109+ runs-on : ubuntu-24.04-arm
110+ target : aarch64-unknown-linux-musl
111+
112+ - os-name : x86_64-darwin
113+ runs-on : macos-latest
114+ target : x86_64-apple-darwin
115+
116+ - os-name : aarch64-darwin
117+ runs-on : macos-latest
118+ target : aarch64-apple-darwin
119+
120+ - os-name : windows-x86_64
121+ runs-on : public-amd64-4xlarge-dind-germany
122+ target : x86_64-pc-windows-gnu
123+
124+ runs-on : ${{ matrix.platform.runs-on }}
125+ steps :
126+ # we've been hitting out of free space issues
127+ - name : Delete unnecessary tools folder
128+ run : rm -rf /opt/hostedtoolcache
129+
130+ - name : Install build tools (Windows and Linux build)
131+ shell : bash
132+ if : ${{ !contains(matrix.platform.os-name, 'darwin') }}
133+ run : |
134+ sudo bash -c 'cat << EOF > /etc/apt/sources.list
135+ deb http://mirror.hetzner.com/ubuntu/packages jammy main restricted universe multiverse
136+ deb http://mirror.hetzner.com/ubuntu/packages jammy-updates main restricted universe multiverse
137+ deb http://mirror.hetzner.com/ubuntu/packages jammy-backports main restricted universe multiverse
138+ deb http://mirror.hetzner.com/ubuntu/packages jammy-security main restricted universe multiverse
139+ EOF'
140+ sudo apt-get update
141+ sudo apt-get install -y git-lfs build-essential
142+ git lfs install
143+
144+ - name : Checkout
145+ uses : actions/checkout@v4
146+ with :
147+ lfs : " true"
76148
77149 - name : Setup Rust & Cargo
78150 uses : ./.github/actions/setup_rust_cargo
@@ -99,31 +171,16 @@ jobs:
99171 target : ${{ matrix.platform.target }}
100172 codecov-token : ${{ secrets.CODECOV_TOKEN }}
101173
102- - name : Build darwin target
103- uses : ./.github/actions/build_cli_macos_target
104- if : contains(matrix.platform.os-name, 'darwin')
105- with :
106- target : ${{ matrix.platform.target }}
107- profile : release
108- force-sentry-dev : true
109-
110- - name : Build unix/Windows target
111- uses : ./.github/actions/build_cli_linux_windows_target
112- if : ${{ !contains(matrix.platform.os-name, 'darwin') }}
174+ - name : Download built binary
175+ uses : actions/download-artifact@v4
113176 with :
114- target : ${{ matrix.platform.target }}
115- profile : release
116- force-sentry-dev : true
177+ name : binary-${{ matrix.platform.target }}
178+ path : target/${{ matrix.platform.target }}/release/
117179
118- - name : Extract step outcome
180+ - name : Make binary executable
119181 shell : bash
120- id : extract
121- run : |
122- if [[ "${{steps.tests.outcome}}" == "failure" ]]; then
123- echo "test-step-outcome=1" >> $GITHUB_OUTPUT
124- else
125- echo "test-step-outcome=0" >> $GITHUB_OUTPUT
126- fi
182+ if : ${{ !contains(matrix.platform.os-name, 'windows') }}
183+ run : chmod +x target/${{ matrix.platform.target }}/release/trunk-analytics-cli
127184
128185 - name : Upload results to staging using built CLI
129186 env :
@@ -133,11 +190,16 @@ jobs:
133190 # Windows binaries are tested in the release workflow on actual Windows runners
134191 if : ${{ !contains(matrix.platform.target, 'illumos') && !contains(matrix.platform.os-name, 'windows') }}
135192 run : |
193+ if [[ "${{steps.tests.outcome}}" == "failure" ]]; then
194+ test-step-outcome=1
195+ else
196+ test-step-outcome=0
197+ fi
136198 target/${{ matrix.platform.target }}/release/trunk-analytics-cli upload \
137199 --junit-paths ${{ github.workspace }}/target/**/*junit.xml \
138200 --org-url-slug trunk-staging-org \
139201 --token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} \
140- --test-process-exit-code ${{ steps.extract.outputs. test-step-outcome }}
202+ --test-process-exit-code $test-step-outcome
141203
142204 - name : Upload results to prod using built CLI
143205 shell : bash
@@ -169,13 +231,33 @@ jobs:
169231 - name : Build workspace
170232 run : cargo build --all
171233
234+ - name : Trunk Check
235+ uses : trunk-io/trunk-action@v1
236+ with :
237+ cache : false
238+
239+ build_pyo3 :
240+ name : Build context-py
241+ runs-on : ubuntu-latest
242+
243+ steps :
244+ - uses : actions/checkout@v4
245+
246+ - name : Delete huge unnecessary tools folder
247+ run : rm -rf /opt/hostedtoolcache
248+
172249 - name : Setup and build pyo3
173250 uses : ./.github/actions/setup_build_pyo3
174251
252+ build_wasm :
253+ name : Build context-js (WASM)
254+ runs-on : ubuntu-latest
255+
256+ steps :
257+ - uses : actions/checkout@v4
258+
259+ - name : Delete huge unnecessary tools folder
260+ run : rm -rf /opt/hostedtoolcache
261+
175262 - name : Setup and build wasm
176263 uses : ./.github/actions/setup_build_wasm
177-
178- - name : Trunk Check
179- uses : trunk-io/trunk-action@v1
180- with :
181- cache : false
0 commit comments