Skip to content

Bump k8s.io/component-base from 0.31.0 to 0.31.3 #315

Bump k8s.io/component-base from 0.31.0 to 0.31.3

Bump k8s.io/component-base from 0.31.0 to 0.31.3 #315

Workflow file for this run

name: Continuous Integration
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- '*'
- '!dependabot/**'
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
report:
name: Report
runs-on: ubuntu-latest
steps:
- name: ref
run: echo ${{ github.ref }}
- name: event_name
run: echo ${{ github.event_name }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.55.2
args: --verbose
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22
- id: go-cache-paths
shell: bash
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Go Mod Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Go Build Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-
- name: test
run: make race
image:
name: Build Image
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up QEMU for cross-building
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image urls
id: image-urls
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
IMAGES=ghcr.io/${IMAGE_NAME}
[[ -n "$DOCKER_USERNAME" ]] && IMAGES=${IMAGES},${IMAGE_NAME}
echo "images=${IMAGES}" >> $GITHUB_OUTPUT
- name: Docker manager metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image-urls.outputs.images }}
tags: |
type=sha
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
- name: Determine if workflow should push image
id: should-push
run: |
SHOULD_PUSH=true
# Skip pushing if initiated by dependabot
[[ "$GITHUB_ACTOR" == "dependabot[bot]" ]] && SHOULD_PUSH=false
# Skip pushing if a PR
[[ "$GITHUB_EVENT_NAME" == "pull_request" ]] && SHOULD_PUSH=false
# Skip pushing if a pull request and branch is not main
[[ "$GITHUB_EVENT_NAME" == "push" && "$GITHUB_REF_NAME" != "main" ]] && SHOULD_PUSH=false
echo "should-push=${SHOULD_PUSH}" >> $GITHUB_OUTPUT
- name: Log in to ghcr.io
uses: docker/login-action@v3
if: ${{ steps.should-push.outputs.should-push == 'true' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log into DockerHub
uses: docker/login-action@v3
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
if: ${{ env.DOCKER_USERNAME != '' && steps.should-push.outputs.should-push == 'true' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build
id: docker_build
uses: docker/build-push-action@v6
env:
VERSION: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
with:
context: .
push: ${{ steps.should-push.outputs.should-push == 'true' }}
build-args: |
BINARY=cloud-provider-cherry
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, mode=max, scope=${{ github.workflow }}