Skip to content

README: Update releases #12

README: Update releases

README: Update releases #12

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:
- main
- ft/main/**
# Add this workflow to be triggered by merge queue events
merge_group:
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.21.3
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.21.3
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
# renovate: datasource=docker depName=golangci/golangci-lint
version: v1.54.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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.21.3
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.21.3
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.21.3
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
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