Skip to content

Update go modules (main) (minor) #2334

Update go modules (main) (minor)

Update go modules (main) (minor) #2334

Workflow file for this run

name: Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
Checks:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
disable-telemetry: true
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Go environment
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
cache: true
go-version-file: go.mod
cache-dependency-path: '**/go.sum'
- name: Check go versions
uses: conforma/github-workflows/golang-version-check@db8c967cda18f9d4c69b1808f703fb61cdf1c650 # main
- name: Build all
run: make all
- name: Test
run: make test
- name: Upload unit test coverage report
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cover.out
flags: controller
- name: Upload api test coverage report
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./api_cover.out
flags: api
- name: Upload schema test coverage report
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./schema_cover.out
flags: schema
# If enterprisecontractpolicy_types.go is updated without a corresponding change to the crd
# an uncommitted change can show.
- name: Check for uncommitted changes
run: |
if ! git diff --exit-code -s; then
for f in $(git diff --exit-code --name-only); do
echo "::error file=$f,line=1,col=1,endColumn=1::File was modified in build"
echo -e "\033[1;33mHint:\033[0m Maybe you need to run \033[1;32mmake all\033[0m"
done
exit 1
fi