Skip to content

Bump golang from 1.20.6 to 1.21.0 #422

Bump golang from 1.20.6 to 1.21.0

Bump golang from 1.20.6 to 1.21.0 #422

Workflow file for this run

name: Main commit workflow
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v*
paths-ignore:
- '**.md'
pull_request_target:
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'
env:
platforms: linux/amd64,linux/arm64
registry: ghcr.io
image: ghcr.io/${{ github.repository_owner }}/ipam
jobs:
go-lint:
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup golang
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Configure git for private modules
run: ./hack/setup-git-redirect.sh
env:
GITHUB_PAT: ${{ secrets.BOT_PAT }}
- name: Lint golang sources
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.1
args: -e S1008 --timeout 15m
go-test:
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup golang
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Configure git for private modules
run: ./hack/setup-git-redirect.sh
env:
GITHUB_PAT: ${{ secrets.BOT_PAT }}
- name: Run tests
run: make test
kustomize-test:
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Complie manifests
uses: azure/k8s-bake@v2
with:
renderEngine: 'kustomize'
kustomizationPath: './config/default/'
kubectl-version: 'latest'
silent: 'false'
docker-build:
needs: [ kustomize-test, go-lint, go-test ]
runs-on: [ self-hosted, Linux, X64 ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for docker
uses: docker/metadata-action@v4
id: meta
with:
images: |
${{ env.image }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
flavor: |
latest=${{ github.ref == 'refs/heads/main' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: ${{env.platforms}}
- name: Set up Docker Context for Buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
timeout-minutes: 5
uses: docker/setup-buildx-action@v2
with:
version: latest
endpoint: builders
- name: Build and push
uses: docker/build-push-action@v4
timeout-minutes: 60
with:
context: .
platforms: ${{ env.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GOPRIVATE=github.com/onmetal/*
secrets: |
"github_pat=${{ secrets.BOT_PAT }}"