forked from grafana-tools/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to GH actions (grafana-tools#129)
* Move to GH actions Move from Travis CI to GitHub actions because TravisCI is kind of laggy & only free up to some small amount of CI minutes. * github/go: migrate more stuff * github/go: add missing keyword * github/go: add env var * github/go: add chromedp * Remove unused file, add shouldSkip * github/go: add separate jobs * .github: add coveralls * *: fix after sdk.NewClient() changes * rest: dashboard: set board IDs to different values * actions: only calc coverage on newest Grafana * actions: specify ./... * .github: use atomic mode * go: update chromedp * gh actions: try fix * *: add more prints * github/go: quote val * github: try another way * github: run tests once
- Loading branch information
Showing
15 changed files
with
157 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
strategy: | ||
matrix: | ||
go: [1.16, 1.15, 1.14] | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run linters | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.41 | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
go: [1.16, 1.15, 1.14] | ||
grafana: [6.7.1, 6.6.2, 6.5.3, 6.4.5] | ||
|
||
env: | ||
GRAFANA_INTEGRATION: 1 | ||
|
||
services: | ||
grafana: | ||
# Docker Hub image | ||
image: "grafana/grafana:${{ matrix.grafana }}" | ||
ports: | ||
- 3000:3000 | ||
options: >- | ||
-e GF_AUTH_ANONYMOUS_ENABLED=true | ||
chromedp: | ||
image: "chromedp/headless-shell:91.0.4472.69" | ||
ports: | ||
- 9222:9222 | ||
options: >- | ||
--shm-size 2G | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
# Calculate coverage with the newest Go version. | ||
- name: Calc coverage | ||
if: "${{ matrix.go == '1.16' && matrix.grafana == '6.7.1' }}" | ||
run: | | ||
go test -v -covermode=atomic -coverprofile=coverage.out ./... | ||
- name: Test | ||
if: "${{ matrix.go != '1.16' && matrix.grafana != '6.7.1' }}" | ||
run: go test -v ./... | ||
- name: Convert coverage.out to coverage.lcov | ||
if: "${{ matrix.go == '1.16' && matrix.grafana == '6.7.1' }}" | ||
uses: jandelgado/[email protected] | ||
- name: Coveralls | ||
if: "${{ matrix.go == '1.16' && matrix.grafana == '6.7.1' }}" | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-lcov: coverage.lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.