Skip to content

Update push-chart workflow concurrency group #28763

Update push-chart workflow concurrency group

Update push-chart workflow concurrency group #28763

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/**
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
jobs:
go-mod:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.20.4
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
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
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.20.4
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
persist-credentials: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
with:
# renovate: datasource=docker depName=golangci/golangci-lint
version: v1.52.2
skip-cache: true
args: "--out-${NO_FUTURE}format colored-line-number --verbose --modules-download-mode=vendor"
precheck:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.20.4
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
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
steps:
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.20.4
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
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
steps:
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: 1.20.4
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
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