-
Notifications
You must be signed in to change notification settings - Fork 10
146 lines (140 loc) · 4.13 KB
/
ci.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- v*.*.*
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
ruleset:
name: Ruleset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
bazelrc: common --announce_rc --color=yes
repository-cache: true
- run: bazel run :buildifier.check
- run: bazel test ...
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
examples-gem:
name: Examples / Gem
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ruby:
- 3.1.6
- 3.2.6
- 3.3.6
- 3.4.0-preview2
- jruby-9.4.9.0
- truffleruby-24.1.1
- system
os:
- ubuntu-latest
# Use Intel-based macOS for now because Ruby 3.1 doesn't compile on Apple Silicon.
- macos-13
- windows-latest
mode:
- bzlmod
- WORKSPACE
exclude:
# Previews are unavailable on Windows.
- os: windows-latest
ruby: 3.4.0-preview2
# TruffleRuby doesn't work on Windows.
- os: windows-latest
ruby: truffleruby-24.1.1
defaults:
run:
working-directory: examples/gem
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
bazelrc: common --announce_rc --color=yes ${{ matrix.mode == 'WORKSPACE' && '--enable_workspace' || '' }}
# Workaround for long path issues: https://github.com/jruby/jruby/issues/3995.
output-base: ${{ matrix.os == 'windows-latest' && 'D:/b' || '' }}
repository-cache: examples/gem/${{ matrix.mode == 'WORKSPACE' && 'WORKSPACE' || 'MODULE.bazel' }}
- run: echo ${{ matrix.ruby }} > .ruby-version
- if: matrix.ruby == 'system'
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.6"
- run: bazel build ...
- run: bazel run lib/gem:add-numbers 2
- run: bazel run lib/gem:print-version
- run: bazel run "@ruby" "--" -e "puts RUBY_VERSION"
- run: bazel run "@ruby//:bundle" "--" lock
- run: bazel run "@ruby//:gem" "--" info
- run: bazel run "@bundle//bin:rake" "--" --version
- run: bazel run "@bundle//bin:rspec" "--" --help
- run: bazel test ...
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
examples-jekyll:
name: Examples / Jekyll
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- macos
defaults:
run:
working-directory: examples/jekyll
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
bazelrc: common --announce_rc --color=yes
repository-cache: examples/jekyll/MODULE.bazel
- run: bazel build ...
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
examples-native_ext:
name: Examples / Native Ext
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ruby:
- 3.3.6
- jruby-9.4.9.0
defaults:
run:
working-directory: examples/native_ext
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
bazelrc: common --announce_rc --color=yes
repository-cache: examples/native_ext/MODULE.bazel
- run: echo ${{ matrix.ruby }} > .ruby-version
- run: bazel build ...
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
release:
name: Release
if: startsWith(github.ref, 'refs/tags/v')
needs:
- ruleset
- examples-gem
- examples-jekyll
- examples-native_ext
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7
with:
mount_bazel_caches: false
prerelease: false
release_files: rules_ruby-*.tar.gz