-
Notifications
You must be signed in to change notification settings - Fork 2.1k
147 lines (137 loc) · 4.76 KB
/
test.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
147
name: Testing
on:
push:
branches:
- '**'
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
rack-protection:
name: rack-protection (${{ matrix.ruby }}, rack ${{ matrix.rack }}, rack-session ${{ matrix.rack_session }})
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
rack:
- stable
rack_session:
- stable
ruby:
- "2.6"
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "jruby"
- "truffleruby"
include:
# Rack
- { ruby: 3.2, rack: head, rack_session: stable }
- { ruby: 3.2, rack: stable, rack_session: head }
# https://github.com/sinatra/sinatra/issues/1988
- { ruby: ruby-head, rack: stable, rack_session: stable, allow-failure: true }
env:
rack: ${{ matrix.rack }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
continue-on-error: ${{ matrix.allow-failure || false }}
id: setup-ruby
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
working-directory: rack-protection
- name: Run rack-protection tests
continue-on-error: ${{ matrix.allow-failure || false }}
id: protection-tests
working-directory: rack-protection
run: |
bundle exec rake
# because continue-on-error marks the steps as pass even if they fail
- name: "setup-ruby (bundle install) outcome: ${{ steps.setup-ruby.outcome }}"
run: ""
- name: "rack-protection tests outcome: ${{ steps.protection-tests.outcome }}"
run: ""
- uses: zzak/action-discord@v6
if: failure() && github.ref_name == 'main'
continue-on-error: true # always allow failure
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}
sinatra:
name: ${{ matrix.ruby }} (Rack ${{ matrix.rack }}, Puma ${{ matrix.puma }}, Tilt ${{ matrix.tilt }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
puma:
- stable
rack:
- stable
tilt:
- stable
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby, truffleruby]
include:
# Rack
- { ruby: 3.2, rack: head, puma: stable, tilt: stable, allow-failure: true }
# Puma
- { ruby: 3.2, rack: stable, puma: head, tilt: stable, allow-failure: true }
# Tilt
- { ruby: 3.2, rack: stable, puma: stable, tilt: head, allow-failure: true }
# Never fail our build due to problems with head
- { ruby: ruby-head, rack: stable, puma: stable, tilt: stable, allow-failure: true }
- { ruby: jruby-head, rack: stable, puma: stable, tilt: stable, allow-failure: true }
- { ruby: truffleruby-head, rack: stable, puma: stable, tilt: stable, allow-failure: true }
env:
rack: ${{ matrix.rack }}
puma: ${{ matrix.puma }}
tilt: ${{ matrix.tilt }}
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes \
pandoc \
nodejs \
pkg-config \
libxml2-dev \
libxslt-dev \
libyaml-dev
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
continue-on-error: ${{ matrix.allow-failure || false }}
id: setup-ruby
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# Update rubygems due to https://github.com/rubygems/rubygems/pull/6490
rubygems: ${{ matrix.ruby == '3.0' && 'latest' || 'default' }}
- name: Run sinatra tests
continue-on-error: ${{ matrix.allow-failure || false }}
id: tests
run: bundle exec rake
- name: Run sinatra-contrib tests
continue-on-error: ${{ matrix.allow-failure || false }}
id: contrib-tests
working-directory: sinatra-contrib
run: |
bundle install --jobs=3 --retry=3
bundle exec rake
# because continue-on-error marks the steps as pass even if they fail
- name: "setup-ruby (bundle install) outcome: ${{ steps.setup-ruby.outcome }}"
run: ""
- name: "sinatra tests outcome: ${{ steps.tests.outcome }}"
run: ""
- name: "sinatra-contrib tests outcome: ${{ steps.contrib-tests.outcome }}"
run: ""
- uses: zzak/action-discord@v6
if: failure() && github.ref_name == 'main'
continue-on-error: true # always allow failure
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook: ${{ secrets.DISCORD_WEBHOOK }}