RPC #330
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: Ruby | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
name: >- | |
${{ matrix.ruby }} (sudo: ${{ matrix.sudo }}) | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
sudo: [true] | |
ruby: | |
- "2.6" | |
- "2.7" | |
- "3.0" | |
- "3.1" | |
- "3.2" | |
- "3.3" | |
include: | |
- { ruby: jruby, allow-failure: true, sudo: false } | |
- { ruby: truffleruby, allow-failure: true, sudo: false } | |
steps: | |
- name: Install RabbitMQ | |
run: sudo apt-get update && sudo apt-get install -y rabbitmq-server | |
- name: Verify RabbitMQ started correctly | |
run: while true; do sudo rabbitmq-diagnostics status 2>/dev/null && break; echo -n .; sleep 2; done | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: ${{ matrix.ruby }} | |
- name: Run tests (excluding TLS tests) | |
continue-on-error: ${{ matrix.allow-failure || false }} | |
run: bundle exec rake | |
env: | |
RUN_SUDO_TESTS: ${{ matrix.sudo }} | |
tls: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
- "ruby" # latest stable release | |
- "jruby" | |
- "truffleruby-23" # https://github.com/cloudamqp/amqp-client.rb/issues/16#issuecomment-2111624251 | |
steps: | |
- name: Install RabbitMQ | |
run: sudo apt-get update && sudo apt-get install -y rabbitmq-server | |
- name: Stop RabbitMQ | |
run: sudo systemctl stop rabbitmq-server | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Install github.com/FiloSottile/mkcert | |
run: brew install mkcert | |
- name: Create local CA | |
run: sudo CAROOT=/etc/rabbitmq $(brew --prefix)/bin/mkcert -install | |
- name: Create certificate | |
run: | | |
sudo $(brew --prefix)/bin/mkcert -key-file /etc/rabbitmq/localhost-key.pem -cert-file /etc/rabbitmq/localhost.pem localhost | |
sudo chmod +r /etc/rabbitmq/localhost-key.pem | |
- name: Create RabbitMQ config | |
run: | | |
sudo tee /etc/rabbitmq/rabbitmq.conf <<'EOF' | |
listeners.ssl.default = 5671 | |
ssl_options.cacertfile = /etc/rabbitmq/rootCA.pem | |
ssl_options.certfile = /etc/rabbitmq/localhost.pem | |
ssl_options.keyfile = /etc/rabbitmq/localhost-key.pem | |
EOF | |
- name: Start RabbitMQ | |
run: sudo systemctl start rabbitmq-server | |
- name: Verify RabbitMQ started correctly | |
run: while true; do sudo rabbitmq-diagnostics status 2>/dev/null && break; echo -n .; sleep 2; done | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: ${{ matrix.ruby }} | |
- name: Run TLS tests | |
run: bundle exec rake | |
env: | |
TESTOPTS: --name=/_tls$/ | |
macos: | |
runs-on: macos-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: # enough to test one Ruby on macOS | |
- "ruby" # latest stable release | |
steps: | |
- name: Install RabbitMQ | |
run: brew install rabbitmq | |
- name: Start RabbitMQ | |
run: brew services start rabbitmq | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: ${{ matrix.ruby }} | |
- name: Verify RabbitMQ started correctly | |
run: while true; do rabbitmq-diagnostics status 2>/dev/null && break; echo -n .; sleep 2; done | |
- name: Run tests (excluding TLS tests) | |
run: bundle exec rake |