Skip to content

Commit ee3a6d9

Browse files
authored
build: add GitHub action for tests (#8)
Closes #6.
1 parent a9c23e2 commit ee3a6d9

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

.github/workflows/test.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run tests
2+
3+
# Trigger on push
4+
on:
5+
push:
6+
7+
permissions:
8+
contents: read
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Install Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24.2'
25+
check-latest: true
26+
27+
- name: Install libraries for ubuntu
28+
run: |
29+
sudo apt install libx11-dev
30+
31+
- name: Print environment
32+
run: |
33+
which go
34+
go env
35+
make vars
36+
37+
- name: Check format
38+
run: make check-format
39+
40+
- name: Check vet
41+
run: make check-vet
42+
43+
- name: Build renku-dev-utils
44+
run: make rdu

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ help: ## Display this help.
5252
.PHONY: format
5353
format: ## Format source files
5454
gofmt -l -w .
55+
56+
.PHONY: check-format
57+
check-format: ## Check that sources are correctly formatted
58+
gofmt -d -s . && git diff --exit-code
59+
60+
.PHONY: check-vet
61+
check-vet: ## Check source files with `go vet`
62+
go vet ./...

pkg/k8s/amaltheasession.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func ForciblyDeleteAmaltheaSessions(ctx context.Context, client *dynamic.Dynamic
8989
for _, server := range servers {
9090
err = ForciblyDeleteAmaltheaSession(ctx, client, namespace, server, gvr)
9191
if err != nil {
92-
fmt.Printf("Ignoring error: %w\n", err)
92+
fmt.Printf("Ignoring error: %s\n", err)
9393
}
9494
}
9595

pkg/k8s/jupyterserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func ForciblyDeleteJupyterServers(ctx context.Context, client *dynamic.DynamicCl
8989
for _, server := range servers {
9090
err = ForciblyDeleteJupyterServer(ctx, client, namespace, server, gvr)
9191
if err != nil {
92-
fmt.Printf("Ignoring error: %w\n", err)
92+
fmt.Printf("Ignoring error: %s\n", err)
9393
}
9494
}
9595

0 commit comments

Comments
 (0)