Skip to content

feat: update tools and dependencies #135

feat: update tools and dependencies

feat: update tools and dependencies #135

Workflow file for this run

name: Continuous Integration Pipeline
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- docs/**
- examples/**
env:
GO_VERSION: 1.21.1
GORELEASER_VERSION: v1.21.2
GO_CACHE: true
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: false
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Set golangci-lint Cache Key
id: create-sha
run: |
echo "GOLANGCILINT_SHA=$(cat ./tools/GOLANGCI_LINT_VERSION | sha256sum - | awk '{ print $1 }')" >> $GITHUB_ENV
- name: Setup golangci-lint Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: |
./tools/bin
key: ${{ runner.os }}-go-${{ env.GOLANGCILINT_SHA }}
restore-keys: |
${{ runner.os }}-go-${{ env.GOLANGCILINT_SHA }}
- name: Run Lint CI
run: make ci-lint GOLANGCI_LINT_MODE="github-actions"
test:
name: Testing on ${{ matrix.os }} #and kubernetes ${{ matrix.k8s_version}}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
# k8s_version:
# - "1.25"
# - "1.26"
# - "1.27"
# - "1.28"
runs-on: ${{ matrix.os }}
# env:
# ENVTEST_K8S_VERSION: ${{matrix.k8s_version}}
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: false
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run Test Coverage
run: make ci
build:
name: Build for Supported Architectures
runs-on: ubuntu-latest
needs:
- lint
- test
if: github.event_name != 'push'
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: false
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Setup Goreleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
version: ${{ env.GORELEASER_VERSION }}
install-only: true
- name: Run Build Multiarchitecture
run: make build-multiarch
publish-release:
runs-on: ubuntu-latest
needs:
- lint
- test
if: github.event_name == 'push'
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: false
fetch-depth: 0
- name: Setup Golang
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Setup Goreleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
version: ${{ env.GORELEASER_VERSION }}
install-only: true
- name: Set Snapshot Release Environment
if: github.ref_type == 'branch'
run: |
echo "SNAPSHOT_RELEASE=1" >> $GITHUB_ENV
- name: Run Goreleaser
run: make ci-release SNAPSHOT_RELEASE=${SNAPSHOT_RELEASE}
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Upload Binaries Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: artifacts
path: bin/
publish-docker:
runs-on: ubuntu-latest
needs:
- publish-release
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
show-progress: false
- name: Download Binaries
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: artifacts
path: bin/
- name: Restore Executable Permissions
run: |
find ./bin/{darwin,linux} -type f -exec chmod +x {} \;
- name: Docker Login to GitHub Repository
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.BOT_DOCKER_USERNAME }}
password: ${{ secrets.BOT_DOCKER_TOKEN }}
- name: Setup QEMU
run: make docker-setup-multiarch
- name: Setup Buildx Context
id: buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Build Latest Image
run: make ci-docker BUILDX_CONTEXT=${{ steps.buildx.outputs.name }}