From a3fd7e1cbee78ec16788522ec0f3c425694e4409 Mon Sep 17 00:00:00 2001 From: cam Date: Thu, 26 Sep 2024 08:46:13 +1200 Subject: [PATCH 1/3] Use github actions instead of travis --- .github/workflows/goreleaser.yml | 15 +++++++++++++++ .travis.yml | 20 -------------------- 2 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/goreleaser.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..4c25ec2 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,15 @@ +name: Go CI and Release + +on: + push: + branches: + - '**' + tags: + - '*' + pull_request: + branches: + - '**' + +jobs: + build: + uses: TheCacophonyProject/github-actions-templates/.github/workflows/go-ci-release.yml@v0.1.1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c6486b6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: go - -go: - - "1.22.x" - -script: - - go mod tidy - - git diff --exit-code || (echo "Please run 'go mod tidy' to clean up the 'go.mod' and 'go.sum' files. Your go version should match the one used with travis."; false) - - go vet ./... - - go test ./... - - curl -sL https://git.io/goreleaser | bash -s check - -# calls goreleaser -deploy: -- provider: script - skip_cleanup: true - script: curl -sL https://git.io/goreleaser | bash - on: - tags: true - go: "1.22.x" From d5a38ba14523dcc87f94dbaa51ee6c64d10a0054 Mon Sep 17 00:00:00 2001 From: cam Date: Thu, 26 Sep 2024 08:46:41 +1200 Subject: [PATCH 2/3] fix staticcheck error --- eventstore/eventstore_test.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/eventstore/eventstore_test.go b/eventstore/eventstore_test.go index 0122280..d6c794e 100644 --- a/eventstore/eventstore_test.go +++ b/eventstore/eventstore_test.go @@ -36,28 +36,28 @@ type Suite struct { store *EventStore } -func (suite *Suite) SetupTest() { +func (s *Suite) SetupTest() { tempDir, err := os.MkdirTemp(os.TempDir(), "eventstore_test") - suite.Require().NoError(err) - suite.tempDir = tempDir + s.Require().NoError(err) + s.tempDir = tempDir - suite.store = suite.openStore() + s.store = s.openStore() } -func (suite *Suite) openStore() *EventStore { - store, err := Open(filepath.Join(suite.tempDir, "store.db")) - suite.Require().NoError(err) +func (s *Suite) openStore() *EventStore { + store, err := Open(filepath.Join(s.tempDir, "store.db")) + s.Require().NoError(err) return store } -func (suite *Suite) TearDownTest() { - if suite.store != nil { - suite.store.Close() - suite.store = nil +func (s *Suite) TearDownTest() { + if s.store != nil { + s.store.Close() + s.store = nil } - if suite.tempDir != "" { - os.RemoveAll(suite.tempDir) - suite.tempDir = "" + if s.tempDir != "" { + os.RemoveAll(s.tempDir) + s.tempDir = "" } } From 211d3ed275eb2720fe3036b29e723b1be20cd856 Mon Sep 17 00:00:00 2001 From: cam Date: Thu, 26 Sep 2024 08:48:23 +1200 Subject: [PATCH 3/3] Set goreleaser version --- .goreleaser.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index c7f9b7e..f654724 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,8 @@ project_name: event-reporter dist: dist +version: 2 + release: github: owner: TheCacophonyProject