Skip to content

Commit 0d3c147

Browse files
committed
MacOS runners are ultra expensive, only run on demand
Also remove Ruby 3.2 from CI and add 4.0
1 parent c778e91 commit 0d3c147

File tree

2 files changed

+462
-124
lines changed

2 files changed

+462
-124
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -72,82 +72,6 @@ jobs:
7272
with:
7373
name: gem-${{ steps.set-metadata.outputs.GEM_VERSION }}-ruby
7474
path: pkg
75-
build-darwin:
76-
strategy:
77-
fail-fast: false
78-
matrix:
79-
platform:
80-
- arm64
81-
- x86_64
82-
include:
83-
- platform: arm64
84-
runner: macos-15-xlarge
85-
- platform: x86_64
86-
runner: macos-15-large
87-
name: Build (darwin) (${{ matrix.platform }})
88-
outputs:
89-
GEM_VERSION: ${{ steps.set-metadata.outputs.GEM_VERSION }}
90-
runs-on: ${{ matrix.runner }}
91-
env:
92-
TARGET_PLATFORM: ${{ matrix.platform }}-darwin
93-
RUBY_TARGET_PLATFORM: ${{ matrix.platform }}-darwin
94-
steps:
95-
- name: Checkout
96-
uses: actions/checkout@v2
97-
- name: Bundle
98-
run: bundle install
99-
- name: Set metadata
100-
id: set-metadata
101-
run: |
102-
./libexec/metadata ruby_platform | tee ruby_platform
103-
echo "RUBY_PLATFORM=$RUBY_TARGET_PLATFORM" >> $GITHUB_OUTPUT
104-
./libexec/metadata gem_platform | tee gem_platform
105-
echo "GEM_PLATFORM=$TARGET_PLATFORM" >> $GITHUB_OUTPUT
106-
./libexec/metadata gem_version | tee gem_version
107-
echo "GEM_VERSION=$(cat gem_version)" >> $GITHUB_OUTPUT
108-
./libexec/metadata node_version | tee node_version
109-
echo "NODE_VERSION=$(cat node_version)" >> $GITHUB_OUTPUT
110-
./libexec/metadata libv8_version | tee libv8_version
111-
echo "LIBV8_VERSION=$(cat libv8_version)" >> $GITHUB_OUTPUT
112-
- name: Download Node.js
113-
run: |
114-
./libexec/download-node ${{ steps.set-metadata.outputs.NODE_VERSION }}
115-
- name: Extract Node.js
116-
run: |
117-
./libexec/extract-node ${{ steps.set-metadata.outputs.NODE_VERSION }}
118-
- name: Validate V8 version
119-
run: |
120-
./libexec/metadata libv8_version_h | tee libv8_version_h
121-
diff libv8_version_h libv8_version
122-
- name: Build V8
123-
run: |
124-
./libexec/build-libv8 ${{ steps.set-metadata.outputs.NODE_VERSION }}
125-
- name: Build Monolith
126-
run: |
127-
./libexec/build-monolith ${{ steps.set-metadata.outputs.NODE_VERSION }}
128-
- name: Inject V8
129-
run: |
130-
./libexec/inject-libv8 ${{ steps.set-metadata.outputs.NODE_VERSION }}
131-
- name: Test V8 in C++
132-
run: |
133-
cd test/gtest
134-
cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform }}
135-
cd build
136-
cmake --build .
137-
./c_v8_tests
138-
- name: Build binary gem
139-
run: |
140-
bundle exec rake binary
141-
- name: Upload V8
142-
uses: actions/upload-artifact@v4
143-
with:
144-
name: v8-${{ steps.set-metadata.outputs.LIBV8_VERSION }}-${{ steps.set-metadata.outputs.GEM_PLATFORM }}
145-
path: vendor
146-
- name: Upload gem
147-
uses: actions/upload-artifact@v4
148-
with:
149-
name: gem-${{ steps.set-metadata.outputs.GEM_VERSION }}-${{ steps.set-metadata.outputs.GEM_PLATFORM }}
150-
path: pkg
15175
build-linux:
15276
strategy:
15377
fail-fast: false
@@ -310,12 +234,6 @@ jobs:
310234
- amd64
311235
- arm64
312236
container:
313-
- image: ruby:3.2
314-
version: '3.2'
315-
libc: gnu
316-
- image: ruby:3.2-alpine
317-
version: '3.2'
318-
libc: musl
319237
- image: ruby:3.3
320238
version: '3.3'
321239
libc: gnu
@@ -331,6 +249,12 @@ jobs:
331249
- image: ruby:3.4-alpine
332250
version: '3.4'
333251
libc: musl
252+
- image: ruby:4.0
253+
version: '4.0'
254+
libc: gnu
255+
- image: ruby:4.0-alpine
256+
version: '4.0'
257+
libc: musl
334258
include:
335259
- platform: amd64
336260
runner: ubuntu-24.04
@@ -376,51 +300,14 @@ jobs:
376300
docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle install
377301
docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake compile
378302
docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake test
379-
test-darwin:
380-
strategy:
381-
fail-fast: false
382-
matrix:
383-
platform:
384-
- arm64
385-
- x86_64
386-
include:
387-
- platform: arm64
388-
runner: macos-15-xlarge
389-
- platform: x86_64
390-
runner: macos-15-large
391-
name: Test (darwin) (${{ matrix.platform }})
392-
needs: build-darwin
393-
runs-on: ${{ matrix.runner }}
394-
steps:
395-
- name: Set metadata
396-
id: set-metadata
397-
run: |
398-
echo "${{ matrix.platform }}-darwin" | tee gem_platform
399-
echo "GEM_PLATFORM=$(cat gem_platform)" >> $GITHUB_OUTPUT
400-
- name: Download a single artifact
401-
uses: actions/download-artifact@v4
402-
with:
403-
name: gem-${{ needs.build-darwin.outputs.GEM_VERSION }}-${{ steps.set-metadata.outputs.GEM_PLATFORM }}
404-
path: pkg
405-
- name: Install gem
406-
run: gem install pkg/libv8-node-${{ needs.build-darwin.outputs.GEM_VERSION }}-${{ steps.set-metadata.outputs.GEM_PLATFORM }}.gem
407-
- name: Test with mini_racer
408-
run: |
409-
git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1
410-
cd test/mini_racer
411-
ruby -i -ne '$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"${{ needs.build-darwin.outputs.GEM_VERSION }}\"\n") : print' lib/mini_racer/version.rb
412-
ruby -i -ne '$_ =~ /spec.required_ruby_version/ ? "" : print' mini_racer.gemspec
413-
bundle install
414-
bundle exec rake compile
415-
bundle exec rake test
416303
test-linux:
417304
strategy:
418305
fail-fast: false
419306
matrix:
420307
version:
421-
- '3.2'
422308
- '3.3'
423309
- '3.4'
310+
- '4.0'
424311
platform:
425312
- amd64
426313
- arm64
@@ -432,16 +319,16 @@ jobs:
432319
runner: ubuntu-24.04
433320
- platform: arm64
434321
runner: ubuntu-24.04-arm
435-
- version: '3.2'
436-
platform: 'arm64'
437-
libc: 'gnu'
438322
- version: '3.3'
439323
platform: 'arm64'
440324
libc: 'gnu'
441325
- version: '3.4'
442326
platform: 'arm64'
443327
libc: 'gnu'
444-
- version: '3.4'
328+
- version: '4.0'
329+
platform: 'arm64'
330+
libc: 'gnu'
331+
- version: '4.0'
445332
platform: 'arm64'
446333
libc: 'musl'
447334
name: Test (linux) (${{ matrix.platform }}, ${{ matrix.libc }}, ruby ${{ matrix.version }})

0 commit comments

Comments
 (0)