-
Notifications
You must be signed in to change notification settings - Fork 22
51 lines (41 loc) · 1.19 KB
/
cicd.yml
File metadata and controls
51 lines (41 loc) · 1.19 KB
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
name: Ruby
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby: ['3.1.3', '3.2', '3.3', '3.4']
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.16
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install
- name: Generate random ports
id: portgen
run: |
echo "PORT1=$(( (RANDOM % 1000) + 3000 ))" >> $GITHUB_ENV
echo "PORT2=$(( (RANDOM % 1000) + 4000 ))" >> $GITHUB_ENV
echo "PORT3=$(( (RANDOM % 1000) + 5000 ))" >> $GITHUB_ENV
- name: Print open ports before test
run: lsof -i -P -n | grep LISTEN || true
- name: Run the test suite
run: PORT1=$PORT1 PORT2=$PORT2 PORT3=$PORT3 bundle exec rake
env:
PORT1: ${{ env.PORT1 }}
PORT2: ${{ env.PORT2 }}
PORT3: ${{ env.PORT3 }}
- name: Print open ports after test
if: always()
run: lsof -i -P -n | grep LISTEN || true