Skip to content

Future version 1.0 #191

Future version 1.0

Future version 1.0 #191

Workflow file for this run

name: Go
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v3
with:
go-version: '^1.19.0'
- name: Setup JUnit Report
run: go install github.com/jstemmer/go-junit-report/v2@bfac3ec
- name: Set up tparse
run: go install github.com/mfridman/tparse@latest
- name: Check Format
run: if [ "$(gofmt -d -s -l . | tee /dev/fd/2 | wc -l)" -gt 0 ]; then exit 1; fi
- name: Go Work Sync
run: go work sync
- name: Get dependencies
run: |
cd azkustodata
go get -v -t -d ./...
- name: Build data
run: |
cd azkustodata
go build -v ./...
- name: Run tests data
run: |
cd azkustodata
go test -p 100 -race -coverprofile=coverage.out -json -v ./... 2>&1 > /tmp/gotest-data.log
env:
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
AZURE_CLIENT_ID: ${{ secrets.APP_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.APP_KEY }}
AZURE_TENANT_ID: ${{ secrets.AUTH_ID }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
SECONDARY_ENGINE_CONNECTION_STRING: ${{ secrets.SECONDARY_ENGINE_CONNECTION_STRING }}
SECONDARY_DATABASE: ${{ secrets.SECONDARY_DATABASE }}
GOMAXPROCS: 200
- name: Get dependencies ingest
run: |
cd azkustoingest
go get -v -t -d ./...
- name: Build ingest
run: |
cd azkustoingest
go build -v ./...
- name: Run tests ingest
run: |
cd azkustoingest
go test -p 100 -race -coverprofile=coverage.out -json -v ./... 2>&1 > /tmp/gotest-ingest.log
env:
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
AZURE_CLIENT_ID: ${{ secrets.APP_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.APP_KEY }}
AZURE_TENANT_ID: ${{ secrets.AUTH_ID }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
SECONDARY_ENGINE_CONNECTION_STRING: ${{ secrets.SECONDARY_ENGINE_CONNECTION_STRING }}
SECONDARY_DATABASE: ${{ secrets.SECONDARY_DATABASE }}
GOMAXPROCS: 200
- name: Display tests data
if: always()
run: |
tparse -all -file=/tmp/gotest-data.log
- name: Parse tests data
if: always()
run: |
go-junit-report -parser gojson < /tmp/gotest-data.log > report-data.xml
- name: Display tests ingest
if: always()
run: |
tparse -all -file=/tmp/gotest-ingest.log
- name: Parse tests ingest
if: always()
run: |
go-junit-report -parser gojson < /tmp/gotest-ingest.log > report-ingest.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results
path: report*.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
publish-test-results:
name: "Publish Unit Tests Results"
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml