Skip to content

Commit 48d1f88

Browse files
chore: configure gh action for tests (#24)
this commit lays down the foundation for running tests as part of the pull request workflow. tests are not there yet but now we can start adding them. go has been bumped to 1.21 as well. an entry for the e2e tests was created.
1 parent 185ebde commit 48d1f88

File tree

4 files changed

+116
-1
lines changed

4 files changed

+116
-1
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Pull request
2+
on:
3+
- pull_request
4+
5+
jobs:
6+
tests:
7+
name: Test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: Setup Go
14+
uses: actions/setup-go@v4
15+
with:
16+
go-version: "1.21.0"
17+
18+
- name: Go vet
19+
run: |
20+
make vet
21+
22+
- name: Unit tests
23+
run: |
24+
make unit-tests
25+
26+
- name: E2E tests
27+
run: |
28+
make e2e-tests
29+
30+
build:
31+
name: Build
32+
runs-on: ubuntu-latest
33+
needs:
34+
- tests
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@v4
41+
with:
42+
go-version: "1.21.0"
43+
44+
- name: Build Linux AMD64
45+
run: |
46+
make helmvm-linux-amd64
47+
48+
- name: Build Darwin AMD64
49+
run: |
50+
make helmvm-darwin-amd64
51+
52+
- name: Build Darwin ARM64
53+
run: |
54+
make helmvm-darwin-arm64
55+
56+
- name: Build HelmVM Builder Server Image
57+
uses: docker/build-push-action@v4
58+
with:
59+
push: false

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ helmvm-darwin-arm64: static static-darwin-arm64
123123
builder: static static-linux-amd64
124124
CGO_ENABLED=0 go build -o ./output/bin/$(BUILDER_NAME) ./cmd/builder
125125

126+
.PHONY: unit-tests
127+
unit-tests:
128+
go test -v ./...
129+
130+
.PHONY: vet
131+
vet: static-linux-amd64 static
132+
go vet ./...
133+
134+
.PHONY: e2e-tests
135+
e2e-tests:
136+
echo to be implemented
137+
126138
.PHONY: clean
127139
clean:
128140
rm -rf output

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/replicatedhq/helmvm
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/AlecAivazis/survey/v2 v2.3.6

0 commit comments

Comments
 (0)