Skip to content

Commit 05d949d

Browse files
committed
Run tests on all commits (without Docker)
1 parent c65a847 commit 05d949d

File tree

3 files changed

+31
-44
lines changed

3 files changed

+31
-44
lines changed

.github/workflows/k6-tests.yaml renamed to .github/workflows/build-and-test.yaml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
name: Run k6 Test Suite
2-
on:
3-
push:
4-
paths:
5-
- 'scripts/**'
6-
- 'k6/**'
7-
release:
8-
types:
9-
- created
10-
11-
# Important: The k6 test suite will only be run against the latest
12-
# release of the Quickpizza service, not against the code in the
13-
# commit itself. Therefore, we only run this Action when the test
14-
# files themselves are modified (or on a new release).
1+
name: Build and Test
2+
on: [push]
153

164
jobs:
175
runner-job:
186
runs-on: ubuntu-latest
197

20-
services:
21-
quickpizza:
22-
image: ghcr.io/grafana/quickpizza-local:latest
23-
ports:
24-
- 3333:3333
25-
- 3334:3334
26-
278
steps:
289
- name: Checkout
2910
uses: actions/checkout@v4
3011

12+
- name: Setup Go
13+
uses: actions/setup-go@v5
14+
15+
- name: Setup Goimports
16+
run: go install golang.org/x/tools/cmd/goimports@latest
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
22+
- name: Check Formatting
23+
run: make format-check
24+
25+
- name: Build Binary
26+
run: make build
27+
28+
- name: Start Server
29+
run: ./bin/quickpizza &
30+
3131
# Enable cache for system files: https://github.com/actions/toolkit/issues/946
3232
- name: root suid tar
3333
run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar
@@ -72,3 +72,6 @@ jobs:
7272
run: ./scripts/run-tests.sh -t **/k6/browser/*.js -u http://localhost:3333
7373
env:
7474
ACT: ${{ env.ACT }}
75+
76+
- name: Stop Server
77+
run: pkill -9 quickpizza

.github/workflows/build.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
GO_SOURCES=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
22

3-
# Note: does not include frontend files, only Go code.
43
.PHONY: build
54
build:
5+
PUBLIC_BACKEND_ENDPOINT="" PUBLIC_BACKEND_WS_ENDPOINT="" cd pkg/web && \
6+
npm install && npm run build
7+
go build -o bin/quickpizza ./cmd
8+
9+
# Note: does not include frontend files, only Go code.
10+
.PHONY: build-mock
11+
build-mock:
612
go build -tags=mock -o bin/quickpizza ./cmd
713

814
.PHONY: proto

0 commit comments

Comments
 (0)