Skip to content

页面展示更多方法元数据 #133

页面展示更多方法元数据

页面展示更多方法元数据 #133

Workflow file for this run

# 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: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
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 -fr example/target && rm -fr example/ellyn_common && 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: Test Example
run: cd example && go test -v -coverprofile="coverage_example.txt" -coverpkg="example,github.com/lvyahui8/ellyn/ellyn_agent,github.com/lvyahui8/ellyn/ellyn_api" ./... 2>&1 | tee output.txt && cat output.txt | go-junit-report -set-exit-code > ../junit_example.xml
- 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 }}