Skip to content

Commit

Permalink
[misc] update workflow (#17)
Browse files Browse the repository at this point in the history
* [misc] update workflow

* [fix] staticcheck

* [fix] remove build job

* [misc] workflow
  • Loading branch information
gvaligiani authored Mar 20, 2023
1 parent 5e90bef commit 7431507
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
38 changes: 22 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
# https://github.com/CircleCI-Public/circleci-demo-go/blob/master/.circleci/config.yml
version: 2
jobs:
build:
docker:
# specify the version
- image: cimg/go:1.17
version: 2.1

orbs:
ta-go: travelaudience/[email protected]

steps:
- checkout
- run: go test -race -count=1 -coverprofile=profile.out ./...
executors:
golang-executor:
docker:
- image: golang:1.19.0-bullseye
environment:
GO111MODULE: "on"
GOPRIVATE: github.com/travelaudience/*
working_directory: /go/src/github.com/travelaudience/go-sx/

workflows:
version: 2
build-workflow:
build_and_test:
jobs:
- build

- ta-go/checks:
name: check
exec: golang-executor
run-static-analysis: true

- ta-go/test_and_coverage:
name: test
exec: golang-executor
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/travelaudience/go-sx

go 1.13
go 1.19

require (
github.com/DATA-DOG/go-sqlmock v1.3.3
Expand Down
6 changes: 3 additions & 3 deletions helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ func TestLimitOffset(t *testing.T) {
func TestInsertPanic(t *testing.T) {
// InsertQuery should panic if all of a struct's fields are tagged readonly.
type ohNo struct {
field1 int `sx:",readonly"`
field2 int `sx:",readonly"`
_ int `sx:",readonly"`
_ int `sx:",readonly"`
}
const wantPanic = "sx: struct ohNo has no usable fields"

Expand Down Expand Up @@ -409,7 +409,7 @@ func TestUpdateFields(t *testing.T) {
},
}

type menagerie1 struct {
type _ struct {
Chimpanzee int64 `sx:"human"`
Flamingo string `sx:",readonly"`
Warthog string `sx:"-"`
Expand Down
4 changes: 1 addition & 3 deletions matching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ func TestMatching(t *testing.T) {
}

type test3 struct {
a int
}

type test4 struct {
A int `sx:"-"`
B int `sx:"foo"`
C int `sx:"bar"`
d int `sx:"baz"`
_ int `sx:"baz"`
}

t.Run("panics on bad input", func(t *testing.T) {
Expand All @@ -40,7 +39,6 @@ func TestMatching(t *testing.T) {
data interface{}
wantPanic string
}{

{
name: "pass a struct, not a pointer",
data: test1{},
Expand Down

0 comments on commit 7431507

Please sign in to comment.