chore: optimized lease for provider index #868
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: Tests and Code coverage | |
on: | |
pull_request: | |
push: | |
branches: | |
- development | |
- master | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Generate coverage report | |
run: | | |
make test-coverage | |
filepaths+=" $(find ./ -type f -name '*.go' -exec grep -l 'DO NOT COVER' {} \;)" | |
filepaths+=" $(find ./ -type f -name '*.pb.go')" | |
filepaths+=" $(find ./ -type f -name '*.pb.gw.go')" | |
filepaths+=" $(find ./ -type f -path '*/client/cli/*')" | |
filepaths+=" $(find ./ -type f -path '*/expected/*')" | |
filepaths+=" $(find ./ -type f -path '*/services/*')" | |
for filepath in ${filepaths}; do | |
filepath=$(echo ${filepath} | sed 's@^[email protected]/sentinel-official/hub/v[0-9]*@g') | |
echo "Excluding file ${filepath} from coverage report..." | |
sed -i "/$(echo ${filepath} | sed 's@/@\\/@g')/d" ./coverage.txt | |
done | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.txt | |
token: ${{ secrets.CODECOV_TOKEN }} |