Skip to content

[update] improved test coverage #194

[update] improved test coverage

[update] improved test coverage #194

Workflow file for this run

name: Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.22.4' ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add hosts to /etc/hosts
# For testing purposes, we need to add the hosts to /etc/hosts
run: (echo "127.0.0.1 backend1.local" && echo "127.0.0.1 backend2.local") | sudo tee -a /etc/hosts
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run test
run: make test
- name: Run coverage
run: make test-cover OUT=coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.5.0
with:
fail_ci_if_error: true
file: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true