Refactoring CLI tooling to make testing easier #420
Workflow file for this run
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
name: Go | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
# lint: | |
# strategy: | |
# matrix: | |
# go: [ 1.20.2 ] | |
# | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# - name: Set up Go | |
# uses: actions/setup-go@v4 | |
# 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: Verify go version | |
# run: go version | |
# | |
# - name: Run linters | |
# uses: golangci/[email protected] | |
# with: | |
# version: v1.52.1 | |
test: | |
strategy: | |
matrix: | |
go: [ 1.21.0] | |
grafana: [ 9.4.3, 10.0.0 ] | |
chromedp: [ 112.0.5615.39 ] | |
env: | |
GRAFANA_INTEGRATION: 1 | |
services: | |
minio: | |
image: bitnami/minio:latest | |
ports: | |
- 9000:9000 | |
- 9001:9001 | |
options: >- | |
-e GF_AUTH_ANONYMOUS_ENABLED=true -e MINIO_ROOT_USER="test" -e MINIO_ROOT_PASSWORD="secretsss" | |
grafana: | |
# Docker Hub image | |
image: "grafana/grafana:${{ matrix.grafana }}" | |
ports: | |
- 3000:3000 | |
options: >- | |
-e GF_AUTH_ANONYMOUS_ENABLED=true | |
chromedp: | |
image: "chromedp/headless-shell:${{ matrix.chromedp }}" | |
ports: | |
- 9222:9222 | |
options: >- | |
--shm-size 2G | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Verify go version | |
run: go version | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Wait for Minio to come up. | |
run: nc -z -v -w15 127.0.0.1 9000 | |
- name: Calc coverage | |
if: "${{ matrix.go == '1.21.0' && matrix.grafana == '9.4.3' }}" | |
run: | | |
go test -v -covermode=atomic -coverprofile=coverage.out ./... | |
- name: Convert coverage.out to coverage.lcov | |
if: "${{ matrix.go == '1.21.0' && matrix.grafana == '9.4.3' }}" | |
uses: jandelgado/[email protected] | |
- name: Test | |
if: "${{ matrix.grafana != '9.4.3' }}" | |
run: go test -v ./... | |