Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Feb 13, 2024
1 parent f35edd3 commit 1bfde91
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.21"]
go: ["1.21", "1.22"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Run tests
run: |
go test -v -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... ./...
- if: ${{ matrix.go == '1.21' }}
- if: ${{ matrix.go == '1.22' }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.txt
Expand All @@ -32,13 +32,13 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.22"
cache: false
- name: Run lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.55
version: v1.56
args: --timeout 5m
4 changes: 2 additions & 2 deletions operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var (
"$in": {Function: multiComparison("IN"), RequiredArguments: 1},
"$notin": {Function: multiComparison("NOT IN"), RequiredArguments: 1},
"$isnull": {
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return filter.Where(tx, column+" IS NULL")
},
RequiredArguments: 0,
Expand All @@ -102,7 +102,7 @@ var (
RequiredArguments: 0,
},
"$notnull": {
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return filter.Where(tx, column+" IS NOT NULL")
},
RequiredArguments: 0,
Expand Down
10 changes: 5 additions & 5 deletions search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestSearchScope(t *testing.T) {
Fields: []string{"name", "email"},
Query: "My Query",
Operator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestSearchScopeEmptyField(t *testing.T) {
Fields: []string{},
Query: "My Query",
Operator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestSeachScopeWithJoin(t *testing.T) {
Fields: []string{"name", "Relation.name"},
Query: "My Query",
Operator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down Expand Up @@ -244,7 +244,7 @@ func TestSeachScopeWithJoinNestedRelation(t *testing.T) {
Fields: []string{"name", "Relation.NestedRelation.field"},
Query: "My Query",
Operator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down Expand Up @@ -457,7 +457,7 @@ func TestSearchScopeWithUnsupportedDataType(t *testing.T) {
Fields: []string{"name", "email"},
Query: "My Query",
Operator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down
4 changes: 2 additions & 2 deletions settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestScope(t *testing.T) {
paginator, err := prepareTestScope(t, &Settings[*TestScopeModel]{
FieldsSearch: []string{"email"},
SearchOperator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down Expand Up @@ -196,7 +196,7 @@ func TestScopeUnpaginated(t *testing.T) {
results, db := prepareTestScopeUnpaginated(t, &Settings[*TestScopeModel]{
FieldsSearch: []string{"email"},
SearchOperator: &Operator{
Function: func(tx *gorm.DB, filter *Filter, column string, dataType DataType) *gorm.DB {
Function: func(tx *gorm.DB, filter *Filter, column string, _ DataType) *gorm.DB {
return tx.Or(fmt.Sprintf("%s LIKE (?)", column), filter.Args[0])
},
RequiredArguments: 1,
Expand Down

0 comments on commit 1bfde91

Please sign in to comment.