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-07-19 21:57:41 +00:00
|
|
|
name: Ruby ${{ matrix.ruby }} (Rack ${{ matrix.rack }})
|
2021-04-17 17:03:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-02-16 22:16:34 +00:00
|
|
|
timeout-minutes: 5
|
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-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-02-21 15:32:37 +00:00
|
|
|
ruby: [2.6, 2.7, '3.0', 3.1, 'jruby-9.3']
|
2022-07-19 21:57:41 +00:00
|
|
|
include:
|
|
|
|
- { ruby: 3.1, rack: master, allow-failure: true }
|
2022-02-26 10:08:33 +00:00
|
|
|
- { ruby: jruby-head, allow-failure: true }
|
|
|
|
- { ruby: truffleruby-22, allow-failure: true }
|
|
|
|
- { ruby: truffleruby-head, allow-failure: true }
|
2022-07-19 21:57:41 +00:00
|
|
|
env:
|
|
|
|
rack: ${{ matrix.rack }}
|
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
|
|
|
|
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
|
|
|
|
- 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: ""
|