-
Notifications
You must be signed in to change notification settings - Fork 72
58 lines (47 loc) · 1.45 KB
/
build-ruby.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
name: Continuous Integration - Ruby Gem
on:
workflow_call:
inputs:
# Counterintuitive, but this is the value for full history required for rev-list --count
fetch-depth:
default: 0
required: false
type: number
jobs:
ci-test-gem:
name: Perform Ruby Gem CI Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [ "3.0", "3.1", "3.2" ]
defaults:
run:
working-directory: ./_packages/ruby
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ inputs.fetch-depth }}
- name: Cache Ruby Gems and Bundle
id: cache-gems
uses: actions/cache@v3
with:
path: _packages/ruby/vendor/bundle
key: ${{ runner.os }}-build-ci-ruby-${{ matrix.ruby-version }}-gem-${{ hashFiles('_packages/ruby/Gemfile.lock') }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: _packages/ruby
- name: Perform Default Rake Task
run: bundle exec rake
- name: Perform Explicit Rake Test
run: bundle exec rake spec
- name: Build Gem
run: gem build *.gemspec
- name: Archive Gem Artifacts
uses: actions/upload-artifact@v3
with:
name: package-gem-${{ matrix.ruby-version }}
path: _packages/ruby/*.gem