-
Notifications
You must be signed in to change notification settings - Fork 375
106 lines (92 loc) · 2.85 KB
/
portal-loop.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
name: portal-loop
on:
pull_request:
branches:
- master
push:
paths:
- "misc/loop/**"
- ".github/workflows/portal-loop.yml"
branches:
- "master"
# NOTE(albttx): branch name to simplify tests for this workflow
- "ci/portal-loop"
tags:
- "v*"
permissions:
contents: read
packages: write
jobs:
portal-loop:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata portalloopd
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/portalloopd
tags: |
type=raw,value=latest
type=semver,pattern=v{{version}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./misc/loop
target: portalloopd
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
test-portal-loop-docker-compose:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup the images"
run: |
cd misc/loop
docker compose build
docker compose pull
docker compose up -d
- name: "Test1 - Portal loop start gnoland"
run: |
while
block_height=$(curl -s localhost:26657/status | jq -r '.result.sync_info.latest_block_height')
echo "Current block height: $block_height"
[[ "$block_height" -lt 10 ]]
do
sleep 1
done
curl -s localhost:26657/status | jq
- name: "Buid new gnolang/gno image"
run: |
docker build -t ghcr.io/gnolang/gno/gnoland:master -f Dockerfile --target gnoland .
- name: "Wait for new docker image"
run: |
ip_addr=$(cat misc/loop/traefik/gno.yml | grep -o "http://.*:26657")
while
new_ip_addr=$(cat misc/loop/traefik/gno.yml | grep -o "http://.*:26657")
echo "${ip_addr} -> ${new_ip_addr}"
[[ "${ip_addr}" == ${new_ip_addr} ]]
do
sleep 5
done
- name: "Test2 - Wait portal-loop start new image"
run: |
while
block_height=$(curl -s localhost:26657/status | jq -r '.result.sync_info.latest_block_height')
echo "Current block height: $block_height"
[[ "$block_height" -lt 10 ]]
do
sleep 5
done
docker ps -a
curl -s localhost:26657/status | jq