Repository navigation
62 lines (58 loc) · 2.29 KB
/
Copy pathruby.yml
File metadata and controls
62 lines (58 loc) · 2.29 KB
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
name: Ruby
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
with:
ruby-version: '3.3'
bundler-cache: true
bundler: 'latest'
- name: Run rubocop
run: bundle exec rubocop
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
ruby-version: ['3.3', '3.4', '4.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
component:
- { name: abstractions, dir: components/abstractions }
- { name: serialization-json, dir: components/serialization/json }
- { name: serialization-form, dir: components/serialization/form }
- { name: serialization-text, dir: components/serialization/text }
- { name: serialization-multipart, dir: components/serialization/multipart }
- { name: http, dir: components/http }
- { name: authentication-oauth, dir: components/authentication/oauth }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
bundler: 'latest'
cache-version: 2
working-directory: ${{ matrix.component.dir }}
- name: Run tests for ${{ matrix.component.name }}
working-directory: ${{ matrix.component.dir }}
run: bundle exec rake
# The check-ruby-version-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
check-ruby-version-matrix:
runs-on: ubuntu-latest
needs: [lint, build]
if: always()
steps:
- name: All build matrix options are successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: One or more build matrix options failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1