Skip to content

Commit c26525a

Browse files
authored
ci: update the codecheck items and the build items. (#613)
* feat(ci): update codecheck items * feat(ci): build xenon
1 parent 5a471c8 commit c26525a

File tree

3 files changed

+83
-8
lines changed

3 files changed

+83
-8
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build xenon
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image_tag:
7+
required: true
8+
type: string
9+
secrets:
10+
DOCKERHUB_USERNAME:
11+
description: 'username of dockerhub'
12+
required: true
13+
DOCKERHUB_TOKEN:
14+
description: 'password of dockerhub'
15+
required: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v1
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v1
26+
27+
- name: Login to DockerHub
28+
uses: docker/login-action@v1
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Build and push
34+
id: docker_build
35+
uses: docker/build-push-action@v2
36+
with:
37+
push: true
38+
file: build/xenon/Dockerfile
39+
tags: radondb/xenon:${{ inputs.image_tag }}

.github/workflows/code_check.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Code check
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [ main ]
67
paths-ignore:
@@ -20,7 +21,7 @@ on:
2021

2122
jobs:
2223

23-
gofmt:
24+
fmtvet:
2425
runs-on: ubuntu-latest
2526
steps:
2627
- name: Set up Go
@@ -31,10 +32,15 @@ jobs:
3132
- name: Check out source code
3233
uses: actions/checkout@v1
3334

34-
- name: Run go fmt
35-
run: d="$(gofmt -d ../../)" && if [ -n "$d" ]; then echo "format error:" ; echo "$d"; exit 1; fi
35+
- name: Run go fmt/vet
36+
run: |
37+
make fmt
38+
make vet
3639
37-
check-crd:
40+
- name: Check
41+
run: d="$(git status -s)" && if [ -n "$d" ]; then echo "check-crd error:" ; echo "$d"; exit 1; fi
42+
43+
checkcrd:
3844
runs-on: ubuntu-latest
3945
steps:
4046
- name: Set up Go
@@ -46,10 +52,12 @@ jobs:
4652
uses: actions/checkout@v1
4753

4854
- name: Recreate crd
49-
run: make manifests
55+
run: |
56+
make manifests
57+
make generate
5058
5159
- name: Check crd
52-
run: diff charts/mysql-operator/crds config/crd/bases
60+
run: d="$(git status -s)" && if [ -n "$d" ]; then echo "check-crd error:" ; echo "$d"; exit 1; fi
5361

5462
staticcheck:
5563
runs-on: ubuntu-latest
@@ -67,3 +75,17 @@ jobs:
6775

6876
- name: Run staticcheck
6977
run: staticcheck -f stylish ./...
78+
79+
build:
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Set up Go
83+
uses: actions/setup-go@v2
84+
with:
85+
go-version: 1.16
86+
87+
- name: Check out source code
88+
uses: actions/checkout@v1
89+
90+
- name: Make build
91+
run: make build

.github/workflows/publish_images.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ on:
1717
required: true
1818
default: true
1919
type: boolean
20+
build_xenon:
21+
description: ""
22+
required: true
23+
default: true
24+
type: boolean
2025

2126
jobs:
2227
build_operator:
2328
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_operator_image.yml@main
24-
if: ${{ github.event.inputs.build_operator }}
29+
if: ${{ github.event.inputs.build_operator == 'true' }}
2530
with:
2631
image_tag: ${{ github.event.inputs.tag }}
2732
secrets:
@@ -30,7 +35,16 @@ jobs:
3035

3136
build_sidecar:
3237
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_sidecar_image.yml@main
33-
if: ${{ github.event.inputs.build_sidecar }}
38+
if: ${{ github.event.inputs.build_sidecar == 'true' }}
39+
with:
40+
image_tag: ${{ github.event.inputs.tag }}
41+
secrets:
42+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
43+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
44+
45+
build_xenon:
46+
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_xenon_image.yml@main
47+
if: ${{ github.event.inputs.build_xenon == 'true' }}
3448
with:
3549
image_tag: ${{ github.event.inputs.tag }}
3650
secrets:

0 commit comments

Comments
 (0)