Skip to content

cherry-picks from upstream on v1.14.14 for conformance test fix #7

cherry-picks from upstream on v1.14.14 for conformance test fix

cherry-picks from upstream on v1.14.14 for conformance test fix #7

Workflow file for this run

name: Go Related Checks
# Any change in triggers needs to be reflected in the concurrency group.
on:
pull_request: {}
push:
branches:
- v1.14
- ft/v1.14/**
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
jobs:
go-mod:
name: Check Go Modules
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
# renovate: datasource=golang-version depName=go
go-version: 1.22.6
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Check module vendoring
run: |
go mod tidy
go mod vendor
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1)
golangci:
name: Lint Source Code
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
# renovate: datasource=golang-version depName=go
go-version: 1.22.6
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
# renovate: datasource=docker depName=golangci/golangci-lint
version: v1.55.2
skip-cache: true
args: "--out-${NO_FUTURE}format colored-line-number --verbose --modules-download-mode=vendor"
precheck:
runs-on: ubuntu-latest
name: Precheck
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
# renovate: datasource=golang-version depName=go
go-version: 1.22.6
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium
- name: Go code prechecks
run: |
cd src/github.com/cilium/cilium
make precheck
generate-api:
runs-on: ubuntu-latest
name: Generate API
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
# renovate: datasource=golang-version depName=go
go-version: 1.22.6
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium
- name: Check api generated files
run: |
cd src/github.com/cilium/cilium
contrib/scripts/check-api-code-gen.sh
generate-k8s-api:
runs-on: ubuntu-latest
name: Generate k8s API
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
# renovate: datasource=golang-version depName=go
go-version: 1.22.6
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium
- name: Install protobuf dependencies
env:
PROTOBUF_VERSION: 3.12.4
run: |
curl -Lo protoc-$PROTOBUF_VERSION-linux-x86_64.zip https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip
unzip protoc-$PROTOBUF_VERSION-linux-x86_64.zip
sudo chmod +x bin/protoc && sudo cp bin/protoc /usr/local/bin
- name: Check k8s generated files
run: |
# Set GOBIN to ensure 'go install' binaries end up in the same directory
# as the one actions/setup-go adds to PATH, regardless of GOPATH.
export GOBIN="$HOME/go/bin"
cd src/github.com/cilium/cilium
contrib/scripts/check-k8s-code-gen.sh