-
Notifications
You must be signed in to change notification settings - Fork 6
115 lines (111 loc) · 3.48 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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"
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