-
-
Notifications
You must be signed in to change notification settings - Fork 19
65 lines (53 loc) · 1.49 KB
/
verify-installer-works.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
name: Build and Verify Installer Works
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '>=1.20'
# Step 3: Install htmgo CLI
- name: Install htmgo CLI
run: |
GOPRIVATE=github.com/maddalax GOPROXY=direct go install github.com/maddalax/htmgo/cli/htmgo@latest
# Step 4: Generate template using htmgo
- name: Generate myapp template
run: |
htmgo template myapp
# Step 5: Build the app
- name: Build myapp
run: |
cd myapp
htmgo build
# Step 6: Verify that the dist directory exists
- name: Verify build output
run: |
if [ ! -d "./myapp/dist" ]; then
echo "Build directory ./dist/myapp does not exist"
exit 1
fi
shell: bash
# Step 7: Start the server
- name: Start myapp server
run: |
nohup ./myapp/dist/myapp &
# Step 8: Wait for server to start
- name: Wait for server startup
run: sleep 5
# Step 9: Send curl request to verify the server is running
- name: Test server with curl
run: |
curl --fail http://localhost:3000 || exit 1