Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Go 1.20 #23

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,28 @@ jobs:
name: Create Release
steps:
- name: Set version
id: version
run: echo ::set-output name=version::${GITHUB_REF#refs/*/}
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: go.mod
- name: Install Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v3
with:
version: v3.5.0
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
version: v3.8.0
- uses: creekorful/[email protected]
- name: Make Release
env:
VERSION: ${{ steps.version.outputs.version }}
VERSION: ${{ env.VERSION }}
run: |
rm -rf release
make release
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist --debug
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/release_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,32 @@ jobs:
name: Release Docker
steps:
- name: Set version
id: version
run: |
ref=${GITHUB_REF#refs/*/}
if [ $ref = "main" ]; then
version="latest"
else
version=$ref
fi
echo ::set-output name=ref::$ref
echo ::set-output name=version::$version
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
echo "REF=${ref}" >> $GITHUB_ENV
echo "VERSION=${version}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v12
with:
username: oscrobot
password: ${{ secrets.OSC_ROBOT_DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
push: true
tags: ohiosupercomputer/k8-ldap-configmap:${{ steps.version.outputs.version }}
tags: ohiosupercomputer/k8-ldap-configmap:${{ env.VERSION }}
build-args: |
VERSION=${{ steps.version.outputs.ref }}
VERSION=${{ env.REF }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
50 changes: 23 additions & 27 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,54 @@ jobs:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50.1
version: v1.51.2
args: --timeout=2m
skip-cache: true
- name: Run tests
run: make all
- name: Run coverage
run: make coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: go.mod
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
uses: docker/setup-buildx-action@v2
- name: Build
run: make build
- name: Run GoReleaser build
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: build --rm-dist --snapshot
- name: Docker Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: false
tags: docker.io/ohiosupercomputer/k8-ldap-configmap:latest
outputs: type=docker,dest=/tmp/k8-ldap-configmap.tar
- name: Upload Docker image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: image
path: /tmp/k8-ldap-configmap.tar
Expand All @@ -72,29 +68,29 @@ jobs:
name: Test Helm Chart
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v3
with:
version: v3.5.0
- uses: actions/setup-python@v2
version: v3.8.0
- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
uses: helm/chart-testing-action@v2.4.0
- name: Download image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: image
path: /tmp
- name: Run chart-testing (lint)
run: ct lint --target-branch=main --check-version-increment=false
- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.4.0
with:
version: v0.11.1
version: v0.18.0
cluster_name: kind
- name: Load image
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GOPATH := $(shell go env GOPATH)
export GOPATH ?= $(firstword $(subst :, ,$(shell go env GOPATH)))
GOOS := linux
GOARCH := amd64
GOLANGCI_LINT := $(GOPATH)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.50.1
GOLANGCI_LINT_VERSION ?= v1.51.2
VERSION ?= $(shell git describe --tags --abbrev=0 || git rev-parse --short HEAD)
GITSHA := $(shell git rev-parse HEAD)
GITBRANCH := $(shell git rev-parse --abbrev-ref HEAD)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This service uses predefined mappers to build the data for each ConfigMap. Curr

## Kubernetes support

Currently this code is built and tested against Kubernetes 1.21.
Currently this code is built and tested against Kubernetes 1.25.x and 1.26.x.

## Install

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/OSC/k8-ldap-configmap

go 1.19
go 1.20

require (
github.com/go-kit/log v0.2.1
Expand Down