Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
cache: true

- name: Set up postgres
run: docker compose up -d

- name: Build
run: go build -v ./...

- name: Test
run: source pg_env && go test -p=1 -count=1 -failfast -coverprofile=coverage.txt -coverpkg=github.com/qor5/... ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
run_tests.sh
.cursor
.idea
2 changes: 1 addition & 1 deletion queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestEnqueueLockUnlock(t *testing.T) {
}

actualPlan := job.Plan()
if !plan.RunAt.Equal(actualPlan.RunAt) {
if !plan.RunAt.Truncate(time.Microsecond).Equal(actualPlan.RunAt.Truncate(time.Microsecond)) {
t.Fatalf("want run at is %s but get %s", plan.RunAt.String(), actualPlan.RunAt.String())
}
plan.RunAt = actualPlan.RunAt
Expand Down
10 changes: 5 additions & 5 deletions stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func TestStack(t *testing.T) {
t.Log(stack)

stacks := []string{
"github.com/qor5/go-que/stack_test.go:36",
"github.com/qor5/go-que/stack_test.go:17",
"github.com/qor5/go-que/stack_test.go:31",
"qor5/go-que/stack_test.go:25",
"qor5/go-que/stack_test.go:14",
"go-que/stack_test.go:36",
"go-que/stack_test.go:17",
"go-que/stack_test.go:31",
"go-que/stack_test.go:25",
"go-que/stack_test.go:14",
}
for _, s := range stacks {
if !strings.Contains(stack, s) {
Expand Down