Skip to content

Commit 4bff523

Browse files
authored
Chore: Migrate to github actions for CI (#259)
1 parent 26e42d3 commit 4bff523

File tree

9 files changed

+49
-46
lines changed

9 files changed

+49
-46
lines changed

.drone.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/push.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Go CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions: {}
10+
11+
jobs:
12+
go-check:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
19+
- name: Setup
20+
uses: grafana/plugin-ci-workflows/actions/plugins/setup@main # zizmor: ignore[unpinned-uses]
21+
with:
22+
go-version: '1.24.4'
23+
golangci-lint-version: '2.1.6'
24+
25+
- name: Install dependencies
26+
run: go mod download
27+
working-directory: ${{ inputs.plugin-directory }}
28+
shell: bash
29+
30+
- name: Lint
31+
run: golangci-lint run --timeout=5m
32+
shell: bash
33+
34+
- name: Test
35+
run: mage -v test
36+
shell: bash
37+
38+
- name: Build
39+
run: mage
40+
shell: bash

pkg/awsds/asyncDatasource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (ds *AsyncAWSDatasource) handleAsyncQuery(ctx context.Context, req backend.
220220
}
221221

222222
// Apply the default FillMode, overwritting it if the query specifies it
223-
driverSettings := ds.SQLDatasource.DriverSettings()
223+
driverSettings := ds.DriverSettings()
224224
fillMode := driverSettings.FillMode
225225
if q.FillMissing != nil {
226226
fillMode = q.FillMissing

pkg/awsds/authSettings_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// nolint:errcheck
12
package awsds
23

34
import (

pkg/awsds/sessions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (sc *SessionCache) GetSession(c SessionConfig) (*session.Session, error) {
280280
// The previous session is used to obtain STS Credentials
281281
Credentials: newSTSCredentials(sess, c.Settings.AssumeRoleARN, func(p *stscreds.AssumeRoleProvider) {
282282
// Not sure if this is necessary, overlaps with p.Duration and is undocumented
283-
p.Expiry.SetExpiration(expiration, 0)
283+
p.SetExpiration(expiration, 0)
284284
p.Duration = duration
285285
if c.Settings.AuthType == AuthTypeGrafanaAssumeRole {
286286
p.ExternalID = aws.String(c.AuthSettings.ExternalID)

pkg/awsds/sessions_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//nolint:errcheck
12
package awsds
23

34
import (

pkg/sigv4/sigv4.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type Opts struct {
6161

6262
func (c Config) asSha256() (string, error) {
6363
h := sha256.New()
64-
_, err := h.Write([]byte(fmt.Sprintf("%v", c)))
64+
_, err := fmt.Fprintf(h, "%s", c)
6565
if err != nil {
6666
return "", err
6767
}

pkg/sql/api/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
)
1414

1515
var (
16-
ExecuteError = errors.New("error executing query")
17-
StatusError = errors.New("error getting query query status")
18-
StopError = errors.New("error stopping query")
16+
ErrorExecute = errors.New("error executing query")
17+
ErrorStatus = errors.New("error getting query query status")
18+
ErrorStop = errors.New("error stopping query")
1919

2020
backoffMin = 200 * time.Millisecond
2121
backoffMax = 10 * time.Minute

pkg/sql/api/api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestWaitOnQuery(t *testing.T) {
6464
&fakeDS{
6565
statusCounter: 0,
6666
status: []*ExecuteQueryStatus{{}},
67-
statusErr: StatusError,
67+
statusErr: ErrorStatus,
6868
},
6969
nil,
7070
},

0 commit comments

Comments
 (0)