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

ci: update the codecheck items and the build items. #613

Merged
merged 2 commits into from
Jul 22, 2022
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
39 changes: 39 additions & 0 deletions .github/workflows/build_xenon_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build xenon

on:
workflow_call:
inputs:
image_tag:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
description: 'username of dockerhub'
required: true
DOCKERHUB_TOKEN:
description: 'password of dockerhub'
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: build/xenon/Dockerfile
tags: radondb/xenon:${{ inputs.image_tag }}
34 changes: 28 additions & 6 deletions .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Code check

on:
workflow_dispatch:
push:
branches: [ main ]
paths-ignore:
Expand All @@ -20,7 +21,7 @@ on:

jobs:

gofmt:
fmtvet:
runs-on: ubuntu-latest
steps:
- name: Set up Go
Expand All @@ -31,10 +32,15 @@ jobs:
- name: Check out source code
uses: actions/checkout@v1

- name: Run go fmt
run: d="$(gofmt -d ../../)" && if [ -n "$d" ]; then echo "format error:" ; echo "$d"; exit 1; fi
- name: Run go fmt/vet
run: |
make fmt
make vet

check-crd:
- name: Check
run: d="$(git status -s)" && if [ -n "$d" ]; then echo "check-crd error:" ; echo "$d"; exit 1; fi

checkcrd:
runs-on: ubuntu-latest
steps:
- name: Set up Go
Expand All @@ -46,10 +52,12 @@ jobs:
uses: actions/checkout@v1

- name: Recreate crd
run: make manifests
run: |
make manifests
make generate

- name: Check crd
run: diff charts/mysql-operator/crds config/crd/bases
run: d="$(git status -s)" && if [ -n "$d" ]; then echo "check-crd error:" ; echo "$d"; exit 1; fi

staticcheck:
runs-on: ubuntu-latest
Expand All @@ -67,3 +75,17 @@ jobs:

- name: Run staticcheck
run: staticcheck -f stylish ./...

build:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Check out source code
uses: actions/checkout@v1

- name: Make build
run: make build
18 changes: 16 additions & 2 deletions .github/workflows/publish_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ on:
required: true
default: true
type: boolean
build_xenon:
description: ""
required: true
default: true
type: boolean

jobs:
build_operator:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_operator_image.yml@main
if: ${{ github.event.inputs.build_operator }}
if: ${{ github.event.inputs.build_operator == 'true' }}
with:
image_tag: ${{ github.event.inputs.tag }}
secrets:
Expand All @@ -30,7 +35,16 @@ jobs:

build_sidecar:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_sidecar_image.yml@main
if: ${{ github.event.inputs.build_sidecar }}
if: ${{ github.event.inputs.build_sidecar == 'true' }}
with:
image_tag: ${{ github.event.inputs.tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build_xenon:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_xenon_image.yml@main
if: ${{ github.event.inputs.build_xenon == 'true' }}
with:
image_tag: ${{ github.event.inputs.tag }}
secrets:
Expand Down