Skip to content

Commit 1087f24

Browse files
committed
wip: ruby macos matrix
1 parent 4b939c4 commit 1087f24

File tree

1 file changed

+87
-54
lines changed

1 file changed

+87
-54
lines changed

.github/workflows/ci-ffi-ruby.yml

Lines changed: 87 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
steps:
8585
- uses: ruby/setup-ruby@v1
8686
with:
87-
ruby-version: '3.0'
87+
ruby-version: ${{ matrix.RUBY_VERSION }}
8888
- uses: actions/download-artifact@master
8989
with:
9090
name: "linux.gem"
@@ -156,72 +156,105 @@ jobs:
156156
#name: ${{ github.sha }}
157157
#path: pyroscope_ffi/ruby/pkg/*.gem
158158

159-
#macos:
160-
#strategy:
161-
#fail-fast: false
162-
#matrix:
163-
#include:
164-
#- macos-version: "11.0"
165-
#target: x86_64-apple-darwin
166-
#py-platform: macosx-11_0_x86_64
167-
#- macos-version: "11.0"
168-
#target: aarch64-apple-darwin
169-
#py-platform: macosx-11_0_arm64
159+
macos:
160+
strategy:
161+
fail-fast: false
162+
matrix:
163+
include:
164+
- macos-version: "11.0"
165+
target: x86_64-apple-darwin
166+
py-platform: macosx-11_0_x86_64
167+
- macos-version: "11.0"
168+
target: aarch64-apple-darwin
169+
py-platform: macosx-11_0_arm64
170170

171-
#name: macOS - ${{ matrix.platform }}
172-
#runs-on: macos-${{ matrix.macos-version }}
171+
name: macOS - ${{ matrix.platform }}
172+
runs-on: macos-${{ matrix.macos-version }}
173173

174-
#env:
175-
#RUST_TARGET: ${{ matrix.target }}
174+
env:
175+
RUST_TARGET: ${{ matrix.target }}
176176

177-
#steps:
178-
#- uses: actions/checkout@v2
177+
steps:
178+
- uses: actions/checkout@v2
179179

180-
#- uses: actions-rs/toolchain@v1
181-
#with:
182-
#toolchain: stable
183-
#target: ${{ matrix.target }}
184-
#profile: minimal
185-
#override: true
180+
- uses: actions-rs/toolchain@v1
181+
with:
182+
toolchain: stable
183+
target: ${{ matrix.target }}
184+
profile: minimal
185+
override: true
186186

187-
#- uses: ruby/setup-ruby@v1
188-
#with:
189-
#ruby-version: '3.1'
187+
- uses: ruby/setup-ruby@v1
188+
with:
189+
ruby-version: '3.1'
190190

191-
#- name: Install bundles
192-
#run: bundle
193-
#working-directory: pyroscope_ffi/ruby
191+
- name: Install bundles
192+
run: bundle
193+
working-directory: pyroscope_ffi/ruby
194194

195-
#- name: Update lock files
196-
#run: cargo update
197-
#working-directory: pyroscope_ffi/ruby/ext/rbspy
195+
- name: Update lock files
196+
run: cargo update
197+
working-directory: pyroscope_ffi/ruby/ext/rbspy
198198

199-
#- name: Update lock files
200-
#run: cargo update
201-
#working-directory: pyroscope_ffi/ruby/ext/thread_id
199+
- name: Update lock files
200+
run: cargo update
201+
working-directory: pyroscope_ffi/ruby/ext/thread_id
202202

203-
#- name: Build native extensions
204-
#run: rake rbspy_install
205-
#working-directory: pyroscope_ffi/ruby
203+
- name: Build native extensions
204+
run: rake rbspy_install
205+
working-directory: pyroscope_ffi/ruby
206206

207-
#- name: Build native extensions
208-
#run: rake thread_id_install
209-
#working-directory: pyroscope_ffi/ruby
207+
- name: Build native extensions
208+
run: rake thread_id_install
209+
working-directory: pyroscope_ffi/ruby
210210

211-
#- if: matrix.target == 'x86_64-apple-darwin'
212-
#name: Build macos gem
213-
#run: rake x86_64_darwin:gem
214-
#working-directory: pyroscope_ffi/ruby
211+
- if: matrix.target == 'x86_64-apple-darwin'
212+
name: Build macos gem
213+
run: rake x86_64_darwin:gem
214+
working-directory: pyroscope_ffi/ruby
215215

216-
#- if: matrix.target == 'aarch64-apple-darwin'
217-
#name: Build macos gem
218-
#run: rake arm64_darwin:gem
219-
#working-directory: pyroscope_ffi/ruby
216+
- if: matrix.target == 'aarch64-apple-darwin'
217+
name: Build macos gem
218+
run: rake arm64_darwin:gem
219+
working-directory: pyroscope_ffi/ruby
220220

221-
#- uses: actions/upload-artifact@v2
222-
#with:
223-
#name: ${{ github.sha }}
224-
#path: pyroscope_ffi/ruby/pkg/*.gem
221+
- uses: actions/upload-artifact@v2
222+
with:
223+
name: ${{ matrix.target }}
224+
path: pyroscope_ffi/ruby/pkg/*.gem
225+
226+
macos-intel-test:
227+
strategy:
228+
fail-fast: false
229+
matrix:
230+
PYROSCOPE_DETECT_SUBPROCESSES: [1, 0]
231+
PYROSCOPE_ONCPU: [1, 0]
232+
RUBY_VERSION: ['2.6', '2.7', '3.0', '3.1']
233+
needs: ['macos-build']
234+
name: macOS Test
235+
runs-on: macos-12.0
236+
steps:
237+
- uses: ruby/setup-ruby@v1
238+
with:
239+
ruby-version: ${{ matrix.RUBY_VERSION }}
240+
- uses: actions/download-artifact@master
241+
with:
242+
name: "linux.gem"
243+
path: "${{github.workspace}}/ruby"
244+
- run: "cd ${{ github.workspace }}/ruby && ls -l"
245+
- run: "cd ${{ github.workspace }}/ruby && gem install *.gem"
246+
- uses: actions/checkout@v2
247+
with:
248+
submodules: recursive
249+
- name: Run Ruby Script
250+
run: pyroscope_ffi/ruby/scripts/tests/test.rb
251+
env:
252+
PYROSCOPE_RUN_ID: ${{ github.run_id }}
253+
PYROSCOPE_ARCH: x86-64-apple-darwin
254+
PYROSCOPE_API_TOKEN: ${{ secrets.PYROSCOPE_API_TOKEN }}
255+
PYROSCOPE_DETECT_SUBPROCESSES: ${{ matrix.PYROSCOPE_DETECT_SUBPROCESSES }}
256+
PYROSCOPE_ONCPU: ${{ matrix.PYROSCOPE_ONCPU }}
257+
RUBY_VERSION: ${{ matrix.RUBY_VERSION }}
225258

226259
#source:
227260
#name: source

0 commit comments

Comments
 (0)