Add workflow for testing
All checks were successful
Test Project / test (push) Successful in 51s

This commit is contained in:
Adam Štrauch 2024-12-08 02:48:48 +01:00
parent f8b9c4f748
commit 3d77945981
Signed by: cx
GPG key ID: 7262DAFE292BCE20
3 changed files with 37 additions and 2 deletions

30
.gitea/workflows/test.yml Normal file
View file

@ -0,0 +1,30 @@
name: Test Project
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: [moon, amd64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y task
- name: Run tests
run: task test

View file

@ -6,4 +6,9 @@ tasks:
docs: docs:
cmds: cmds:
- swag i --parseDependency --dir api - swag i --parseDependency --dir api
silent: true silent: false
test:
cmds:
- go mod tidy
- go test -v ./...
silent: false

View file

@ -75,7 +75,7 @@ func (np *NodesProcessor) Dump() error {
return true return true
}) })
body, err := json.Marshal(ns) body, err := json.MarshalIndent(ns, "", " ")
if err != nil { if err != nil {
return fmt.Errorf("failed to marshal nodes: %w", err) return fmt.Errorf("failed to marshal nodes: %w", err)
} }