.github/workflows/main.yml in amqp-client-1.1.3 vs .github/workflows/main.yml in amqp-client-1.1.4
- old
+ new
@@ -1,12 +1,13 @@
name: Ruby
on: [push,pull_request]
jobs:
- build:
+ tests:
runs-on: ubuntu-latest
+ timeout-minutes: 5
services:
rabbitmq:
image: rabbitmq:latest
ports:
- 5672/tcp
@@ -17,19 +18,87 @@
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
- ruby: ['2.6', '2.7', '3.0', 'jruby', 'truffleruby']
+ ruby: ['2.6', '2.7', '3.0', '3.1']
+ include:
+ - { ruby: jruby, allow-failure: true }
+ - { ruby: truffleruby, allow-failure: true }
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
+ bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- - name: Run the default task
- run: |
- bundle install
- bundle exec rake
+ - name: Run tests (excluding TLS tests)
+ continue-on-error: ${{ matrix.allow-failure || false }}
+ run: bundle exec rake
env:
- TESTOPTS: --exclude=/_tls$/
AMQP_PORT: ${{ job.services.rabbitmq.ports[5672] }}
+ tls:
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby: ['3.0', 'jruby', 'truffleruby']
+ 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: 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@v2
+ - name: Set up Ruby
+ 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: 5
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby: ['3.0']
+ steps:
+ - name: Install RabbitMQ
+ run: brew install rabbitmq
+ - name: Start RabbitMQ
+ run: brew services start rabbitmq
+ - uses: actions/checkout@v2
+ - name: Set up Ruby
+ 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