Bump github.com/hashicorp/go-retryablehttp from 0.7.4 to 0.7.7 in /tdx-cli #55
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: OnPullRequest | |
on: | |
pull_request: | |
jobs: | |
version-check: | |
runs-on: [ ubuntu-20.04 ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: version-check | |
run: | | |
/bin/bash version-check.sh | |
if [[ $? -eq 1 ]]; then | |
echo "version check failed" | |
exit 1 | |
fi | |
build-test-scan: | |
runs-on: [ ubuntu-20.04 ] | |
needs: [ "version-check" ] | |
env: | |
http_proxy: ${{ secrets.HTTP_PROXY }} | |
https_proxy: ${{ secrets.HTTPS_PROXY }} | |
no_proxy: ${{ secrets.NO_PROXY }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.3' | |
- name: Style Checker | |
run: | | |
gofmt -l . | |
if [[ $(gofmt -l . | wc -l) -gt 0 ]]; then | |
echo "Atleast 1 file need formatting" | |
exit 1 | |
fi | |
- name: Unit Test Coverage | |
run: | | |
test_output=$(cd tdx-cli && make test) | |
if [ $? -ne 0 ]; then | |
echo "Unit tests failed for tdx-cli" | |
exit 1 | |
fi | |
COVERAGE=$(cd tdx-cli && make test-coverage | grep 'total' | awk '{print $3}' | awk -F. '{print $1}') | |
echo "Unit test coverage for tdx-cli is - $COVERAGE%" | |
if [[ $COVERAGE -lt 80 ]]; then | |
echo "Unit test coverage must be above 80%" | |
exit 1 | |
fi | |
test_output=$(cd go-connector && go test ./... -coverprofile=cover.out) | |
if [ $? -ne 0 ]; then | |
echo "Unit tests failed for go-connector" | |
exit 1 | |
fi | |
COVERAGE=$(echo \"$test_output\" | awk '{print $5}' | awk -F. '{print $1}') | |
echo "Unit test coverage for go-connector is - $COVERAGE%" | |
if [[ $COVERAGE -lt 80 ]]; then | |
echo "Unit test coverage must be above 80%" | |
exit 1 | |
fi | |
test_output=$(cd go-tdx && go test ./... --tags=test -coverprofile=cover.out) | |
if [ $? -ne 0 ]; then | |
echo "Unit tests failed for go-tdx" | |
exit 1 | |
fi | |
COVERAGE=$(echo \"$test_output\" | awk '{print $5}' | awk -F. '{print $1}') | |
echo "Unit test coverage for go-tdx is - $COVERAGE%" | |
if [[ $COVERAGE -lt 80 ]]; then | |
echo "Unit test coverage must be above 80%" | |
exit 1 | |
fi |