-
Notifications
You must be signed in to change notification settings - Fork 18
38 lines (37 loc) · 1.35 KB
/
ci-pull-request.yml
File metadata and controls
38 lines (37 loc) · 1.35 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
name: ci-pull-request
on:
pull_request: {}
jobs:
pr:
name: pr
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
with:
ruby-version: '3.2'
bundler-cache: true
- name: 'Build Docker image'
uses: 'docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8' # v6.19.2
with:
context: '.'
load: true
tags: "rko-router-test:latest"
- name: 'Start container for test'
run: |
set -x
docker kill rko-router-dut || :
docker container wait rko-router-dut || :
while docker inspect rko-router-dut >/dev/null; do sleep 1; done
docker run --rm --name rko-router-dut --publish 127.0.0.1::8080 --detach rko-router-test:latest
export TARGET_HOST="http://$(docker port rko-router-dut 8080)"
for i in {1..10}; do
if curl -Ssf "${TARGET_HOST}/healthz"; then break; fi
sleep 1
done
curl -f -D- "${TARGET_HOST}/healthz"
- name: 'Run test suite'
run: |
set -x
export TARGET_HOST="http://$(docker port rko-router-dut 8080)"
bundle exec rspec -fd || ( docker logs rko-router-dut; false )