-
Notifications
You must be signed in to change notification settings - Fork 20
82 lines (71 loc) · 2.38 KB
/
build-gems.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
---
name: Build gems
on:
workflow_dispatch:
push:
branches: ["main", "cross-gem/*", "pkg/*"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci-data:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.fetch.outputs.result }}
steps:
- id: fetch
uses: oxidize-rb/actions/fetch-ci-data@v1
with:
supported-ruby-platforms: |
# Excluding:
# `arm-linux`: Cranelift doesn't support 32-bit architectures
# `x64-mingw32`: `x64-mingw-ucrt` should be used for Ruby 3.1+ (https://github.com/rake-compiler/rake-compiler-dock?tab=readme-ov-file#windows)
# 3.0 is deprecated as stable ruby version according to:
# https://github.com/oxidize-rb/actions/blob/main/fetch-ci-data/evaluate.rb#L54
exclude: [arm-linux, x64-mingw32]
stable-ruby-versions: |
exclude: [head]
native:
name: Build native gems
needs: ci-data
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-platform: ${{ fromJSON(needs.ci-data.outputs.result).supported-ruby-platforms }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
- uses: oxidize-rb/actions/cross-gem@v1
id: cross-gem
with:
platform: ${{ matrix.ruby-platform }}
ruby-versions: ${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ',') }}
- uses: actions/upload-artifact@v4
with:
name: cross-gem-${{ matrix.ruby-platform }}
path: ${{ steps.cross-gem.outputs.gem-path }}
if-no-files-found: error
- name: Smoke gem install
if: matrix.ruby-platform == 'x86_64-linux' # GitHub actions architecture
run: bundle install && bundle exec rake pkg:${{ matrix.ruby-platform }}:test
source:
name: Build source gem
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
ruby: ["3.4"]
steps:
- uses: actions/checkout@v4
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cargo-cache: false
cache-version: v2
- name: Smoke test gem install
shell: bash
run: bundle exec rake pkg:ruby:test