Skip to content

.github/workflows/onmergerelease.yml #25

.github/workflows/onmergerelease.yml

.github/workflows/onmergerelease.yml #25

Workflow file for this run

name: OnMergeRelease
on:
push:
branches:
- 'main'
- 'release/*'
tags:
- '**'
jobs:
build-test:
runs-on: [ self-hosted ]
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
- uses: actions/setup-go@v2
with:
go-version: '1.22.3'
- 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: [ self-hosted ]
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:
- uses: actions/setup-go@v2
with:
go-version: '1.22.5'
- name: Push Installer
run: make push-artifact
cleanup-images-bins:
runs-on: [ self-hosted ]
needs: [ "build-test", "artifact-installer" ]
steps:
- name: Clean generated binaries.
run: make clean