Feat/architecture #18
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: Run - Integration Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
integration_tests: | |
name: Run Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21.5 | |
- name: Run Tests | |
run: | | |
cd src | |
go test -count=2 -v ./... | |
- name: Generate Coverage Profile | |
run: | | |
cd src | |
go test -coverprofile=coverage.out ./... | |
- name: Display Coverage Percentage | |
run: | | |
coverage_percentage=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | tr -d '%') | |
echo "Coverage percentage: $coverage_percentage" | |
python -c "import sys; sys.exit(0 if float('$coverage_percentage') >= 80 else 1)" || (echo "Coverage is less than 80%. Please increase the coverage."; exit 1) |