test(keeper/api): trigger taoskeeper ci #4
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: taoskeeper CI | |
on: | |
push: | |
paths: | |
- tools/keeper/** | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Run unit tests | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.18 | |
- name: Start TDengine | |
run: | | |
docker pull tdengine/tdengine:latest | |
docker run --name tdengine -d -p 6030:6030 -p 6041:6041 -p 6043-6060:6043-6060 -p 6043-6060:6043-6060/udp tdengine/tdengine | |
- name: Build taoskeeper | |
working-directory: tools/keeper | |
run: | | |
go mod tidy | |
go build -v ./... | |
- name: Run tests with coverage | |
working-directory: tools/keeper | |
run: | | |
sudo go test -v -coverpkg=./... -coverprofile=coverage.out ./... | |
go tool cover -func=coverage.out | |
- name: Clean up | |
if: always() | |
run: | | |
docker stop tdengine | |
docker rm tdengine |