Skip to content

Update go modules (main) (minor) #1831

Update go modules (main) (minor)

Update go modules (main) (minor) #1831

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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- 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@main
- name: Build all
run: make all
- name: Test
run: make test
- name: Upload unit test coverage report
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cover.out
flags: controller
- name: Upload api test coverage report
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./api_cover.out
flags: api
- name: Upload schema test coverage report
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
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