2021-04-17 17:03:20 +00:00
|
|
|
name: Testing
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-02 12:51:46 +00:00
|
|
|
- '**'
|
2021-04-17 17:03:20 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2022-11-08 18:49:42 +00:00
|
|
|
name: ${{ matrix.ruby }} (Rack ${{ matrix.rack }}, Puma ${{ matrix.puma }})
|
2021-04-17 17:03:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-04-19 20:03:04 +00:00
|
|
|
timeout-minutes: 15
|
2021-04-17 17:03:20 +00:00
|
|
|
strategy:
|
2021-06-02 12:51:46 +00:00
|
|
|
fail-fast: false
|
2021-04-17 17:03:20 +00:00
|
|
|
matrix:
|
2022-11-08 18:19:43 +00:00
|
|
|
puma:
|
|
|
|
- '~> 5' # Due to https://github.com/puma/puma/issues/3000
|
2022-07-19 21:57:41 +00:00
|
|
|
rack:
|
|
|
|
- stable
|
2021-04-17 17:03:20 +00:00
|
|
|
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
2022-07-20 10:20:36 +00:00
|
|
|
ruby: [2.6, 2.7, '3.0', 3.1, 'jruby-9.3', truffleruby, truffleruby-head]
|
2022-07-19 21:57:41 +00:00
|
|
|
include:
|
2022-11-08 18:19:43 +00:00
|
|
|
- { ruby: 3.1, rack: stable, puma: latest, allow-failure: true }
|
|
|
|
- { ruby: 3.1, rack: latest, allow-failure: true }
|
2022-07-19 22:34:28 +00:00
|
|
|
- { ruby: jruby-head, rack: stable, allow-failure: true }
|
2022-07-19 21:57:41 +00:00
|
|
|
env:
|
|
|
|
rack: ${{ matrix.rack }}
|
2022-11-08 18:19:43 +00:00
|
|
|
puma: ${{ matrix.puma }}
|
2021-04-17 17:03:20 +00:00
|
|
|
steps:
|
2022-05-10 13:24:28 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-04-17 17:03:20 +00:00
|
|
|
- uses: ruby/setup-ruby@v1
|
2022-07-19 22:30:10 +00:00
|
|
|
continue-on-error: ${{ matrix.allow-failure || false }}
|
|
|
|
id: setup-ruby
|
2021-04-17 17:03:20 +00:00
|
|
|
with:
|
|
|
|
ruby-version: ${{ matrix.ruby }}
|
|
|
|
bundler-cache: true
|
|
|
|
- name: Install dependencies
|
|
|
|
run: sudo apt-get install -y pandoc nodejs pkg-config libxml2-dev libxslt-dev
|
2022-02-05 11:30:48 +00:00
|
|
|
- name: Run sinatra tests
|
2022-07-19 21:57:41 +00:00
|
|
|
continue-on-error: ${{ matrix.allow-failure || false }}
|
|
|
|
id: tests
|
2022-02-05 11:30:48 +00:00
|
|
|
run: bundle exec rake
|
|
|
|
- name: Run sinatra-contrib tests
|
2022-07-19 21:57:41 +00:00
|
|
|
continue-on-error: ${{ matrix.allow-failure || false }}
|
|
|
|
id: contrib-tests
|
2022-02-18 06:46:58 +00:00
|
|
|
working-directory: sinatra-contrib
|
2022-02-05 11:30:48 +00:00
|
|
|
run: |
|
|
|
|
bundle install --jobs=3 --retry=3
|
|
|
|
bundle exec rake
|
|
|
|
- name: Run rack-protection tests
|
2022-07-19 21:57:41 +00:00
|
|
|
continue-on-error: ${{ matrix.allow-failure || false }}
|
|
|
|
id: protection-tests
|
2022-02-18 06:46:58 +00:00
|
|
|
working-directory: rack-protection
|
2022-02-05 11:30:48 +00:00
|
|
|
run: |
|
|
|
|
bundle install --jobs=3 --retry=3
|
|
|
|
bundle exec rake
|
2021-05-07 22:00:46 +00:00
|
|
|
- uses: 8398a7/action-slack@v3
|
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
2021-05-07 22:20:24 +00:00
|
|
|
fields: repo,message,commit,author,ref,job,took # selectable (default: repo,message)
|
2021-05-07 22:00:46 +00:00
|
|
|
env:
|
2021-05-07 22:20:24 +00:00
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
|
|
|
|
MATRIX_CONTEXT: ${{ toJson(matrix) }} # required
|
2021-06-02 12:46:05 +00:00
|
|
|
if: failure() && env.SLACK_WEBHOOK_URL
|
2022-07-19 21:57:41 +00:00
|
|
|
# because continue-on-error marks the steps as pass even if they fail
|
2022-07-19 22:30:10 +00:00
|
|
|
- name: "setup-ruby (bundle install) outcome: ${{ steps.setup-ruby.outcome }}"
|
|
|
|
run: ""
|
2022-07-19 21:57:41 +00:00
|
|
|
- name: "sinatra tests outcome: ${{ steps.tests.outcome }}"
|
|
|
|
run: ""
|
|
|
|
- name: "sinatra-contrib tests outcome: ${{ steps.contrib-tests.outcome }}"
|
|
|
|
run: ""
|
|
|
|
- name: "rack-protection tests outcome: ${{ steps.protection-tests.outcome }}"
|
|
|
|
run: ""
|