日志性能优化500ns/op->50ns/op && 日志增加datetime前缀 #258
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 workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Unittest | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
goos: [ linux, darwin, windows ] | |
goarch: [ amd64, arm64 ] | |
include: | |
- goos: windows | |
exclude: | |
- goos: windows | |
goarch: arm64 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
- name: goid_init | |
run: chmod +x goid_init.sh && ./goid_init.sh | |
- name: Install go-junit-report | |
run: go install github.com/jstemmer/go-junit-report/v2@latest | |
- name: Clean | |
run: rm -f sdk/meta/*.dat && rm -fr example/target && rm -fr example/ellyn_agent | |
- name: Build | |
run: go build -v ./... | |
- name: Test Ellyn | |
run: go test -v -coverprofile="coverage.txt" -coverpkg="$(go list -mod=mod ./... | tr '\n' ',')" ./... 2>&1 | tee output.txt && cat output.txt | go-junit-report -set-exit-code > junit.xml | |
- name: Update example | |
run: go test -v -run TestExample ./instr | |
- name: Test Example | |
run: cd example && go test -v -coverprofile="coverage_example.txt" -coverpkg="example,github.com/lvyahui8/ellyn/sdk/agent,github.com/lvyahui8/ellyn/api" ./... 2>&1 | tee output.txt && cat output.txt | go-junit-report -set-exit-code > ../junit_example.xml | |
- name : Run Benchmark | |
run: sh ./benchmark/benchmark.sh | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |