fix: fix lintings #58
1 changed files with 67 additions and 23 deletions
90
.github/workflows/ci.yaml
vendored
90
.github/workflows/ci.yaml
vendored
|
|
@ -104,11 +104,55 @@ jobs:
|
||||||
--gpgPubKeyFile=public_key.pem \
|
--gpgPubKeyFile=public_key.pem \
|
||||||
--version=${VERSION}
|
--version=${VERSION}
|
||||||
|
|
||||||
|
testing:
|
||||||
|
name: CI run tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: config
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: ./.github/actions/build
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
|
||||||
|
- name: Setup Terraform
|
||||||
|
uses: hashicorp/setup-terraform@v2
|
||||||
|
with:
|
||||||
|
terraform_wrapper: false
|
||||||
|
|
||||||
|
- name: "Run go mod tidy"
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Testing
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
- name: Acceptance Testing
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
run: make test-acceptance-tf
|
||||||
|
|
||||||
|
- name: Check coverage threshold
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make coverage
|
||||||
|
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
|
||||||
|
echo "Coverage: $COVERAGE%"
|
||||||
|
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
|
||||||
|
echo "Coverage is below 80%"
|
||||||
|
# exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Archive code coverage results
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }}
|
||||||
|
path: "stackit/${{ env.CODE_COVERAGE_FILE_NAME }}"
|
||||||
|
|
||||||
main:
|
main:
|
||||||
if: ${{ github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'schedule' }}
|
||||||
name: CI
|
name: CI run build and linting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: config
|
needs: config
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -145,29 +189,29 @@ jobs:
|
||||||
run: make lint
|
run: make lint
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Testing
|
# - name: Testing
|
||||||
run: make test
|
# run: make test
|
||||||
|
#
|
||||||
|
# - name: Acceptance Testing
|
||||||
|
# if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
# run: make test-acceptance-tf
|
||||||
|
#
|
||||||
|
# - name: Check coverage threshold
|
||||||
|
# shell: bash
|
||||||
|
# run: |
|
||||||
|
# make coverage
|
||||||
|
# COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
|
||||||
|
# echo "Coverage: $COVERAGE%"
|
||||||
|
# if (( $(echo "$COVERAGE < 80" | bc -l) )); then
|
||||||
|
# echo "Coverage is below 80%"
|
||||||
|
# # exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
- name: Acceptance Testing
|
# - name: Archive code coverage results
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
# uses: actions/upload-artifact@v4
|
||||||
run: make test-acceptance-tf
|
# with:
|
||||||
|
# name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }}
|
||||||
- name: Check coverage threshold
|
# path: "stackit/${{ env.CODE_COVERAGE_FILE_NAME }}"
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make coverage
|
|
||||||
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
|
|
||||||
echo "Coverage: $COVERAGE%"
|
|
||||||
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
|
|
||||||
echo "Coverage is below 80%"
|
|
||||||
# exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Archive code coverage results
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }}
|
|
||||||
path: "stackit/${{ env.CODE_COVERAGE_FILE_NAME }}"
|
|
||||||
|
|
||||||
config:
|
config:
|
||||||
if: ${{ github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'schedule' }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue