-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 2.16 KB
/
build-and-test-room-manager-amd64.yaml
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
name: Build and Test Room Manager on amd64
on:
pull_request:
branches: [main]
paths:
- 'examples/room-manager/**'
workflow_dispatch:
jobs:
build-and-test-amd64-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
file: examples/room-manager/Dockerfile
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: room-manager:${{ github.event.pull_request.head.sha }}
load: true
- name: Run Room Manager
run: |
docker run -d -p 8080:8080 \
--name gh-runner-room-manager \
--restart always \
-e PORT=8080 \
-e PEERLESS_PURGE_TIMEOUT=600 \
-e FISHJAM_URL=${{ secrets.ROOM_MANAGER_FISHJAM_URL }} \
-e FISHJAM_SERVER_TOKEN=${{ secrets.ROOM_MANAGER_FISHJAM_SERVER_TOKEN }} \
room-manager:${{ github.event.pull_request.head.sha }}
- name: Test Room Manager Healtcheck
run: |
sleep 2
curl -o tmp1.json -s -vvv http://127.0.0.1:8080/health
jq . tmp1.json
[[ $(jq -r .status tmp1.json) == "ok" ]]
- name: Test Room Manager API
run: |
curl -o tmp2.json -s -vvv "http://127.0.0.1:8080/api/rooms?roomName=testRoomName&peerName=testPeerName"
jq '{peerToken: .peerToken, room: .room, peer: .peer}' tmp2.json
[[ $(jq -r .peerToken tmp2.json) != "null" ]]