forked from ruby/strscan
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 2.57 KB
/
ci.yml
File metadata and controls
95 lines (82 loc) · 2.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
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
name: CI
on:
- push
- pull_request
jobs:
host:
name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
ruby:
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- debug
# We need to update 'jruby-XXX' in "if:" too when we update
# this.
- jruby-9.4.5.0
- truffleruby
- truffleruby-head
include:
- { os: windows-latest , ruby: mingw }
- { os: windows-latest , ruby: mswin }
exclude:
- { os: windows-latest , ruby: debug }
- { os: windows-latest , ruby: truffleruby }
- { os: windows-latest , ruby: truffleruby-head }
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake compile
# If strscan in Ruby's master has the same version of this strscan,
# "gem install pkg/*.gem" fails.
- run: bundle exec rake version:bump
if: >-
matrix.ruby == 'debug' ||
matrix.ruby == 'mingw' ||
matrix.ruby == 'mswin'
- run: bundle exec rake build
- uses: actions/upload-artifact@v4
if: >-
matrix.os == 'ubuntu-latest' &&
(matrix.ruby == '3.1' || matrix.ruby == 'jruby-9.4.5.0')
with:
name: gem-${{ matrix.os }}-${{ matrix.ruby }}
path: pkg/
- name: Release
if: >-
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'ubuntu-latest' &&
(matrix.ruby == '3.1' || matrix.ruby == 'jruby-9.4.5.0')
run: |
ruby \
-e 'print("## strscan "); \
puts(ARGF.read.split(/^## /)[1].gsub(/ {.+?}/, ""))' \
NEWS.md > release-note.md
gh release create \
${GITHUB_REF_NAME} \
--discussion-category Announcements \
--notes-file release-note.md || :
gh release upload ${GITHUB_REF_NAME} pkg/*.gem
env:
GH_TOKEN: ${{ github.token }}
- run: bundle exec rake test
- run: gem install --verbose --backtrace pkg/*.gem
- run: gem install test-unit-ruby-core
- name: Run tests on the installed gem
run: ruby run-test.rb
if: matrix.ruby != '2.4' # strscan is a default gem from 2.5