This commit is contained in:
commit
4611dd02b6
4 changed files with 37 additions and 0 deletions
12
.forgejo/workflows/ci.yaml
Normal file
12
.forgejo/workflows/ci.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
name: Test CI
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: golang:1.23-bookworm
|
||||||
|
steps:
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- run: go test -v ./...
|
||||||
3
go.mod
Normal file
3
go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
module test-ci
|
||||||
|
|
||||||
|
go 1.13
|
||||||
11
main.go
Normal file
11
main.go
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func Greet() string {
|
||||||
|
return "Astraevum Forge is online"
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println(Greet())
|
||||||
|
}
|
||||||
11
main_test.go
Normal file
11
main_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestGreet(t *testing.T) {
|
||||||
|
got := Greet()
|
||||||
|
want := "Astraevum Forge is online"
|
||||||
|
if got != want {
|
||||||
|
t.Errorf("got %q, want %q", got, want)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue