Files
home-automation-backend/.github/workflows/short-tests.yml
2025-07-15 17:47:15 +02:00

34 lines
994 B
YAML

name: Run short tests
on:
push:
pull_request:
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
- name: Run short tests with coverage
working-directory: ./src
run: | # TODO: at this moment only Home Assistant component is tested
go test -v --short ./components/homeassistant/... -cover -coverprofile=cover.out
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report_build_${{ github.run_number }}
path: ${{ github.workspace }}/src/cover.out
retention-days: 1
- name: Generate coverage badge
run: |
go install github.com/t-yuki/gocover-cobertura@latest
gocover-cobertura < cover.out > coverage.xml
go install github.com/boumenot/gocover-cobertura@latest
gocover-cobertura -coverprofile=cover.out -o coverage.svg