go upgrade to 1.22.7 (#162) #29
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: OnMergeRelease | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'release/*' | ||
tags: | ||
- '**' | ||
permissions: read-all | ||
jobs: | ||
setup: | ||
runs-on: [ ubuntu-20.04 ] | ||
steps: | ||
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: '1.22.7' | ||
build-test: | ||
runs-on: [ ubuntu-20.04 ] | ||
needs: ["setup"] | ||
env: | ||
http_proxy: ${{ secrets.HTTP_PROXY }} | ||
https_proxy: ${{ secrets.HTTPS_PROXY }} | ||
no_proxy: ${{ secrets.NO_PROXY }} | ||
steps: | ||
- name: Style Checker | ||
run: | | ||
if [ $(make go-fmt | tail -n 1 | grep gofmt | wc -l) -eq 0 ]; then | ||
exit 0 | ||
fi | ||
- name: Unit Test Coverage | ||
run: | | ||
make test-coverage | ||
COVERAGE=$(make test-coverage | grep 'total' | awk '{print $3}' | awk -F. '{print $1}') | ||
echo "Unit test coverage is - $COVERAGE%" | ||
if [[ $COVERAGE -lt 75 ]]; then | ||
echo "Unit test coverage must be above 75% " | ||
exit 1 | ||
fi | ||
artifact-installer: | ||
runs-on: [ ubuntu-20.04 ] | ||
needs: ["setup"] | ||
env: | ||
http_proxy: ${{ secrets.HTTP_PROXY }} | ||
https_proxy: ${{ secrets.HTTPS_PROXY }} | ||
no_proxy: ${{ secrets.NO_PROXY }} | ||
ARTIFACTORY: ${{ secrets.ARTIFACTORY }} | ||
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD}} | ||
needs: [ "build-test" ] | ||
steps: | ||
- name: Push Installer | ||
run: make push-artifact | ||
cleanup-images-bins: | ||
runs-on: [ ubuntu-20.04 ] | ||
needs: [ "build-test", "artifact-installer" ] | ||
steps: | ||
- name: Clean generated binaries. | ||
run: make clean |