Skip to content

Commit

Permalink
ci: update the codecheck items and the build items. (#613)
Browse files Browse the repository at this point in the history
* feat(ci): update codecheck items

* feat(ci): build xenon
runkecheng authored Jul 22, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5a471c8 commit c26525a
Showing 3 changed files with 83 additions and 8 deletions.
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:
@@ -20,7 +21,7 @@ on:

jobs:

gofmt:
fmtvet:
runs-on: ubuntu-latest
steps:
- name: Set up Go
@@ -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
@@ -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
@@ -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
@@ -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:
@@ -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:

0 comments on commit c26525a

Please sign in to comment.