Update operator SDK and CI/CD #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pr_check elasticobjects-operator | |
on: | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- 'docs/**' | |
- 'helm/**' | |
- '.github/**' | |
types: | |
- opened | |
- reopened | |
- edited | |
- synchronize | |
concurrency: | |
group: ci-tests-${{ inputs.git_repo }}-${{ github.ref }}-1 | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Install latest major GO version | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' # The Go version to download | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: 'v1.55' | |
working-directory: '.' | |
args: --allow-parallel-runners -v --timeout 5m | |
skip-pkg-cache: true | |
skip-build-cache: true | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Install latest major GO version | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' # The Go version to download | |
- name: Build executables locally | |
run: | | |
make build | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_PASS }} | |
- name: Dockerise | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
builder: ${{ steps.buildx.outputs.name }} | |
platforms: 'linux/amd64,linux/arm64' | |
tags: kafkaobjects-operator:dev | |
file: Dockerfile | |
push: false | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Install latest major GO version | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' # The Go version to download | |
- name: Test locally | |
run: | |
make test |