Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub actions #41

Merged
merged 3 commits into from
Sep 25, 2024
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
15 changes: 15 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
project_name: event-reporter
dist: dist

version: 2

release:
github:
owner: TheCacophonyProject
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

28 changes: 14 additions & 14 deletions eventstore/eventstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
}

Expand Down