Repository navigation
66 lines (54 loc) · 1.57 KB
/
Copy pathruby.yml
File metadata and controls
66 lines (54 loc) · 1.57 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
63
64
65
66
name: Ruby
on:
workflow_call:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
# Quoted so YAML doesn't parse versions like '4.0' as numbers
ruby: ['3.3', '3.4', '4.0', head]
color: ['~> 1.8', '~> 2.0']
runs-on: ubuntu-latest
env:
COLOR_VERSION: ${{ matrix.color }}
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
bundler-cache: true
- name: Run tests
run: bundle exec rake
package:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['2.6', '3.4', '4.0']
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
- name: Build and verify the installed gem with only runtime dependencies
run: |
mkdir -p pkg
gem build geo_pattern.gemspec --output pkg/geo_pattern.gem
gem install --no-document --install-dir "$RUNNER_TEMP/gems" pkg/geo_pattern.gem
printf 'source "https://rubygems.org"\ngem "geo_pattern"\n' > "$RUNNER_TEMP/Gemfile"
export GEM_HOME="$RUNNER_TEMP/gems"
export GEM_PATH="$GEM_HOME"
export BUNDLE_GEMFILE="$RUNNER_TEMP/Gemfile"
bundle lock --local
bundle exec ruby script/smoke_test.rb