-
Notifications
You must be signed in to change notification settings - Fork 342
42 lines (36 loc) · 1.23 KB
/
chia-test.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
name: Test official Chia Docker Image
on:
pull_request:
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
id: 'tag'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const release = await github.rest.repos.getLatestRelease({
owner: 'Chia-Network',
repo: 'chia-blockchain',
});
return release.data.tag_name;
- run: docker build --build-arg BRANCH="${{ steps.tag.outputs.result }}" -t localtest:latest .
- run: docker run -d --name=chia localtest:latest
- timeout-minutes: 10
run: |
while true; do
HEALTH_STATUS=$(docker inspect --format="{{.State.Health.Status}}" chia)
if [ "$HEALTH_STATUS" == "starting" ]; then
echo "Container chia is still starting. Waiting..."
sleep 1
elif [ "$HEALTH_STATUS" == "healthy" ]; then
echo "Health check succeeded for container chia"
break
else
echo "Health check failed for container chia"
exit 1
fi
done