Skip to content

Remove external json library #636

Remove external json library

Remove external json library #636

Workflow file for this run

name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "**" ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: build
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
steps:
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.APP_ID }}
tenant-id: ${{ secrets.AUTH_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v5
with:
go-version: '^1.22.0'
- name: Setup JUnit Report
run: go install github.com/jstemmer/go-junit-report/v2@7933520
- 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
continue-on-error: true
- 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 ./... 2>&1 > /tmp/gotest-data.log
env:
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
SECONDARY_ENGINE_CONNECTION_STRING: ${{ secrets.SECONDARY_ENGINE_CONNECTION_STRING }}
SECONDARY_DATABASE: ${{ secrets.SECONDARY_DATABASE }}
GOMAXPROCS: 200
continue-on-error: true
- 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 ./... 2>&1 > /tmp/gotest-ingest.log
env:
ENGINE_CONNECTION_STRING: ${{ secrets.ENGINE_CONNECTION_STRING }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}
SECONDARY_ENGINE_CONNECTION_STRING: ${{ secrets.SECONDARY_ENGINE_CONNECTION_STRING }}
SECONDARY_DATABASE: ${{ secrets.SECONDARY_DATABASE }}
BLOB_URI_FOR_TEST: ${{ secrets.BLOB_URI_FOR_TEST }}
GOMAXPROCS: 200
- name: Display tests data
if: always()
run: |
tparse -all -file=/tmp/gotest-data.log
- name: Parse tests data
if: always()
run: cat /tmp/gotest-data.log | go-junit-report -parser gojson > report-data.xml
- name: Display tests ingest
if: always()
run: |
tparse -all -file=/tmp/gotest-ingest.log
- name: Parse tests ingest
if: always()
run: cat /tmp/gotest-ingest.log | go-junit-report -parser gojson > report-ingest.xml
- name: Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: report*.xml
report_individual_runs: true
report_suite_logs: error
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
publish-test-results:
name: "Publish Unit Tests Results"
needs: build
runs-on: ubuntu-latest
if: always()
permissions:
checks: write
pull-requests: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml