Skip to content

Commit b4bd90a

Browse files
committed
add test
1 parent 3aac12e commit b4bd90a

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/test2.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test setup script 2.0
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- one-liner-2.0
8+
paths:
9+
- 'docker-compose2.0/**'
10+
- '.github/workflows/test2.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'docker-compose2.0/**'
16+
- '.github/workflows/test2.yml'
17+
18+
jobs:
19+
test:
20+
name: Test setup script 2.0
21+
runs-on: [self-hosted, Linux, X64]
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Login to GitHub container registry
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Create working directory
34+
run: mkdir temp
35+
36+
- name: Copy compose file
37+
run: cp docker-compose2.0/docker-compose.setup.yaml temp/docker-compose.yaml
38+
39+
- name: Run setup script
40+
working-directory: temp
41+
run: bash ../docker-compose2.0/setup.sh
42+
43+
- name: Wait for stack to be ready
44+
run: sleep 15s
45+
46+
- name: Test health endpoint
47+
run: curl -f http://localhost:8000/api/v1/health
48+
49+
- name: Stop compose stack
50+
if: always()
51+
working-directory: temp
52+
run: docker compose down -v
53+
54+
- name: Cleanup
55+
if: always()
56+
run: sudo rm -rf temp

0 commit comments

Comments
 (0)