feat: support stop cmd to stop opengemini cluster (#31) #48
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: Continuous Integration | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [ opened, synchronize, reopened, ready_for_review ] | |
paths-ignore: | |
- 'docs/**' | |
- 'scripts/**' | |
- '**.md' | |
- '.gitignore' | |
push: # TODO | |
env: | |
GO111MODULE: on | |
GONOSUMDB: "*" | |
GOSUMDB: off | |
jobs: | |
CommitLint: | |
name: commit lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- name: Run commitlint | |
uses: wagoid/commitlint-github-action@v5 | |
GoLint: | |
name: "style check, static check, go vet and other go lint" | |
needs: CommitLint | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: WillAbides/setup-go-faster@v1.7.0 | |
with: | |
go-version: "1.19" | |
- name: Run go version check | |
run: make go-version-check | |
- name: Run go generate check | |
run: make go-generate | |
- name: Run style check | |
run: make style-check | |
- name: Run static check | |
run: make static-check | |
- name: Run go vet check | |
run: make go-vet-check | |
# - name: Run golangci-lint ## TODO: use github-action below | |
# run: make golangci-lint-check | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v3.6.0 | |
with: | |
version: v1.53 | |
# args: --timeout=10m --tests=false --skip-dirs=open_src | |
args: --timeout=10m --tests=false --disable=staticcheck | |
only-new-issues: true | |
skip-pkg-cache: true | |
skip-build-cache: true | |
UT: | |
name: unit test | |
if: github.event.pull_request.draft == false | |
needs: [GoLint] | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ["ubuntu-latest"] # "macOS-latest" | |
go: ["1.19.x"] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: WillAbides/setup-go-faster@v1.7.0 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Run gotest | |
run: | | |
go mod tidy | |
make gotest | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# IntegrationTest: | |
# name: integration test | |
# if: github.event.pull_request.draft == false | |
# needs: [GoLint] | |
# strategy: | |
# fail-fast: true | |
# matrix: | |
# os: ["ubuntu-latest"] # "macOS-latest" | |
# go: ["1.19.x"] | |
# runs-on: ${{ matrix.os }} | |
# timeout-minutes: 30 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 1 | |
# - uses: WillAbides/setup-go-faster@v1.7.0 | |
# with: | |
# go-version: ${{ matrix.go }} | |
# - name: Build gemix | |
# run: | | |
# go mod tidy | |
# go build . | |
# chmod +x ./gemix | |
# cp ./gemix /usr/local/bin | |
# - name: Run integration test | |
# run: | | |
# make integration-test |