Skip to content

Commit

Permalink
Merge pull request #537 from v3io/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
dinal authored Oct 11, 2020
2 parents 1b90384 + 5869c02 commit a91b462
Show file tree
Hide file tree
Showing 17 changed files with 261 additions and 206 deletions.
132 changes: 0 additions & 132 deletions .github/workflows/ci.yaml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
pull_request_target:
branches:
- development
- 'v[0-9]+.[0-9]+.x'

jobs:
test:
name: Lint & test
runs-on: ubuntu-latest
env:
TSDB_TEST_TABLE_PATH: TSDB_INTEGRATION_TESTS/${{ github.sha }}

steps:
- name: Dump github context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: Dump runner context
run: echo "$RUNNER_CONTEXT"
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}

- name: Dump github ref
run: echo "$GITHUB_REF"

- uses: actions/setup-go@v2
with:
go-version: "^1.14.0"

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.number }}/merge

- name: Lint
run: make lint

- name: Test short
run: make test

- name: Test integration
env:
V3IO_API: ${{ secrets.V3IO_API }}
V3IO_ACCESS_KEY: ${{ secrets.V3IO_ACCESS_KEY }}
V3IO_TSDB_CONFIG: ${{ github.workspace }}/test/ci_v3io.yaml
run: make integration

- name: Benchmark
env:
V3IO_API: ${{ secrets.V3IO_API }}
V3IO_ACCESS_KEY: ${{ secrets.V3IO_ACCESS_KEY }}
V3IO_TSDB_CONFIG: ${{ github.workspace }}/test/ci_v3io_bench.yaml
TSDB_BENCH_INGEST_CONFIG: ${{ github.workspace }}/test/benchmark/testdata/tsdb-bench-test-config-ci.yaml
run: make bench
128 changes: 128 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: CI

on:
push:
branches:
- master

release:
types:
- created

jobs:
test:
name: Lint & test
runs-on: ubuntu-latest
env:
TSDB_TEST_TABLE_PATH: TSDB_INTEGRATION_TESTS/${{ github.sha }}

steps:
- name: Dump github context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: Dump runner context
run: echo "$RUNNER_CONTEXT"
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}

- name: Dump github ref
run: echo "$GITHUB_REF"

- uses: actions/setup-go@v2
with:
go-version: "^1.14.0"

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/checkout@v2

- name: Lint
run: make lint

- name: Test short
run: make test

- name: Test integration
env:
V3IO_API: ${{ secrets.V3IO_API }}
V3IO_ACCESS_KEY: ${{ secrets.V3IO_ACCESS_KEY }}
V3IO_TSDB_CONFIG: ${{ github.workspace }}/test/ci_v3io.yaml
run: make integration

- name: Benchmark
env:
V3IO_API: ${{ secrets.V3IO_API }}
V3IO_ACCESS_KEY: ${{ secrets.V3IO_ACCESS_KEY }}
V3IO_TSDB_CONFIG: ${{ github.workspace }}/test/ci_v3io_bench.yaml
TSDB_BENCH_INGEST_CONFIG: ${{ github.workspace }}/test/benchmark/testdata/tsdb-bench-test-config-ci.yaml
run: make bench

release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs:
- test
strategy:
matrix:
go-os:
- linux
- darwin
- windows

steps:
- name: Dump GitHub context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: Dump runner context
run: echo "$RUNNER_CONTEXT"
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}

- name: Dump github ref
run: echo "$GITHUB_REF"

- name: Extract ref info
id: release_info
run: |
echo ::set-output name=REF_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=REF_TAG::${GITHUB_REF#refs/tags/}
- name: Set TSDB_LABEL to release tag
run: |
echo "::set-env name=TSDB_LABEL::${{ steps.release_info.outputs.REF_TAG }}"
- uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: "^1.14.0"

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build binaries for ${{ matrix.go-os }}
run: make bin
env:
GOPATH: ${{ github.workspace }}/go
GOARCH: amd64
GOOS: ${{ matrix.go-os }}

- name: Upload binaries
uses: AButler/[email protected]
with:
files: ${{ github.workspace }}/go/bin/tsdbctl-*
repo-token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/nuclio/ingest/ingest_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func Handler(context *nuclio.Context, event nuclio.Event) (interface{}, error) {
if ref == 0 {
ref, err = tsdbAppender.Add(labels, sampleTime, sample.Value.N)
} else {
err = tsdbAppender.AddFast(labels, ref, sampleTime, sample.Value.N)
err = tsdbAppender.AddFast(ref, sampleTime, sample.Value.N)
}
if err != nil {
return "", errors.Wrap(err, "Failed to add sample")
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/cpuguy83/go-md2man v1.0.10 // indirect
github.com/ghodss/yaml v1.0.0
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9
github.com/imdario/mergo v0.3.7
github.com/nuclio/logger v0.0.1
github.com/nuclio/nuclio-sdk-go v0.0.0-20190205170814-3b507fbd0324
Expand Down
Loading

0 comments on commit a91b462

Please sign in to comment.