Add tests, rename to key_password_command, and fix PEM decryption #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request, workflow_dispatch] | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
jobs: | |
skip_duplicate_runs: | |
uses: ./.github/workflows/skip_duplicate_workflow_runs.yaml | |
rubocop: | |
name: RuboCop linting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.6 | |
bundler-cache: true # `bundle install` and cache | |
- name: rubocop | |
run: bundle exec rake rubocop | |
test_mri: | |
name: >- | |
MRI: ${{ matrix.os }} ${{ matrix.ruby }}${{ matrix.no-ssl }}${{ matrix.yjit }} | |
needs: [rubocop, skip_duplicate_runs] | |
env: | |
CI: true | |
PUMA_TEST_DEBUG: true | |
TESTOPTS: -v | |
PUMA_NO_RUBOCOP: true | |
runs-on: ${{ matrix.os }} | |
if: | | |
!( contains(github.event.pull_request.title, '[ci skip]') | |
|| contains(github.event.pull_request.title, '[skip ci]')) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-20.04, macos-11, macos-12, windows-2022 ] | |
ruby: [ 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, head ] | |
no-ssl: [''] | |
yjit: [''] | |
include: | |
- { os: windows-2022 , ruby: ucrt } | |
- { os: windows-2022 , ruby: mswin } | |
- { os: windows-2022 , ruby: 2.7 , no-ssl: ' no SSL' } | |
- { os: ubuntu-20.04 , ruby: head , yjit: ' yjit' } | |
- { os: ubuntu-20.04 , ruby: 2.7 , no-ssl: ' no SSL' } | |
- { os: ubuntu-22.04 , ruby: 3.1 } | |
- { os: ubuntu-22.04 , ruby: 3.2 } | |
- { os: ubuntu-22.04 , ruby: head } | |
exclude: | |
- { os: windows-2022 , ruby: head } | |
- { os: macos-11 , ruby: 2.4 } | |
- { os: macos-11 , ruby: 2.5 } | |
- { os: macos-11 , ruby: head } | |
steps: | |
- name: repo checkout | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
uses: actions/checkout@v3 | |
- name: load ruby | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
uses: ruby/setup-ruby-pkgs@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
apt-get: ragel | |
brew: ragel | |
# below is only needed for Ruby 2.4 | |
mingw: openssl | |
bundler-cache: true | |
timeout-minutes: 10 | |
# fixes 'has a bug that prevents `required_ruby_version`' | |
- name: update rubygems for Ruby 2.4 - 2.5 | |
if: | | |
contains('2.4 2.5 2.6', matrix.ruby) && | |
(needs.skip_duplicate_runs.outputs.should_skip != 'true') | |
run: gem update --system 3.3.14 --no-document | |
continue-on-error: true | |
timeout-minutes: 5 | |
- name: Compile Puma without SSL support | |
if: | | |
(matrix.no-ssl == ' no SSL') && | |
(needs.skip_duplicate_runs.outputs.should_skip != 'true') | |
shell: bash | |
run: echo 'PUMA_DISABLE_SSL=true' >> $GITHUB_ENV | |
- name: set WERRORFLAG | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
shell: bash | |
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV | |
- name: compile | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
run: bundle exec rake compile | |
- name: Use yjit | |
if: | | |
(matrix.yjit == ' yjit') && | |
(needs.skip_duplicate_runs.outputs.should_skip != 'true') | |
shell: bash | |
run: echo 'RUBYOPT=--yjit' >> $GITHUB_ENV | |
- name: test | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
timeout-minutes: 10 | |
run: bundle exec rake test:all | |
test_non_mri: | |
name: >- | |
NON-MRI: ${{ matrix.os }} ${{ matrix.ruby }}${{ matrix.no-ssl }} | |
needs: [rubocop, skip_duplicate_runs] | |
env: | |
CI: true | |
TESTOPTS: -v | |
PUMA_NO_RUBOCOP: true | |
runs-on: ${{ matrix.os }} | |
if: | | |
!( contains(github.event.pull_request.title, '[ci skip]') | |
|| contains(github.event.pull_request.title, '[skip ci]')) | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { os: ubuntu-20.04 , ruby: jruby } | |
- { os: ubuntu-20.04 , ruby: jruby, no-ssl: ' no SSL' } | |
- { os: ubuntu-20.04 , ruby: jruby-head, allow-failure: true } | |
- { os: ubuntu-20.04 , ruby: truffleruby, allow-failure: true } # Until https://github.com/oracle/truffleruby/issues/2700 is solved | |
- { os: ubuntu-20.04 , ruby: truffleruby-head, allow-failure: true } | |
- { os: macos-11 , ruby: jruby } | |
- { os: macos-11 , ruby: truffleruby, allow-failure: true } | |
- { os: macos-12 , ruby: jruby } | |
- { os: macos-12 , ruby: truffleruby, allow-failure: true } | |
steps: | |
- name: repo checkout | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
uses: actions/checkout@v3 | |
- name: set JAVA_HOME | |
if: | | |
startsWith(matrix.os, 'macos') && | |
(needs.skip_duplicate_runs.outputs.should_skip != 'true') | |
shell: bash | |
run: | | |
echo JAVA_HOME=$JAVA_HOME_11_X64 >> $GITHUB_ENV | |
- name: load ruby, ragel | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
uses: ruby/setup-ruby-pkgs@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
apt-get: ragel | |
brew: ragel | |
bundler: none | |
bundler-cache: true | |
timeout-minutes: 10 | |
- name: Compile Puma without SSL support | |
if: | | |
(matrix.no-ssl == ' no SSL') && | |
(needs.skip_duplicate_runs.outputs.should_skip != 'true') | |
shell: bash | |
run: echo 'PUMA_DISABLE_SSL=true' >> $GITHUB_ENV | |
- name: set WERRORFLAG | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
shell: bash | |
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV | |
- name: compile | |
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }} | |
run: bundle exec rake compile | |
- name: test | |
id: test | |
timeout-minutes: 12 | |
continue-on-error: ${{ matrix.allow-failure || false }} | |
if: | # only run if previous steps have succeeded | |
success() && | |
(needs.skip_duplicate_runs.outputs.should_skip != 'true') | |
run: bundle exec rake test:all | |
- name: >- | |
Test outcome: ${{ steps.test.outcome }} | |
# every step must define a `uses` or `run` key | |
run: echo NOOP |