Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
chore: add CI and other nice things
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Marble committed Aug 13, 2021
1 parent 77fdd41 commit 2ef8e06
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @influxdata/iox-conductor
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/common"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/influx2otel"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/otel2influx"
schedule:
interval: "weekly"
4 changes: 4 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# docs: https://github.com/probot/semantic-pull-requests#configuration
# Always validate the PR title AND all the commits
titleAndCommits: true
allowMergeCommits: false
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ci

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Build
run: go build ./...

- name: Lint
run: ./run-lint.sh
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Package [`ioxsql`](ioxsql) contains an implementation of the `database/sql` driv

## Tests

This project does not run tests as part of CI.
Most tests depend on a running instance of InfluxDB/IOx, and each creates its own database.
To start an in-memory instance, from the [InfluxDB/IOx repository](https://github.com/influxdata/influxdb_iox/) root:
```console
Expand Down
2 changes: 1 addition & 1 deletion ioxsql/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func openNewDatabase(t *testing.T) (*sql.DB, *influxdbiox.Client) {
}
dsn := fmt.Sprintf("%s/%s", address, database)

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
config, err := influxdbiox.ClientConfigFromAddressString(dsn)
require.NoError(t, err)
Expand Down
22 changes: 22 additions & 0 deletions run-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

set -e

cd "$(dirname "$0")"
BASEDIR=$(pwd)

if ! go vet ./... ; then
fail=1
fi

unformatted=$(gofmt -s -l -e "${BASEDIR}")
if [ ! -z "$unformatted" ] ; then
for filename in $unformatted ; do
gofmt -s -d "$filename"
done
fail=1
fi

if [ -n "$fail" ] ; then
exit 1
fi

0 comments on commit 2ef8e06

Please sign in to comment.