From 442c954de954821effc0de94bac474e8fabe34ea Mon Sep 17 00:00:00 2001 From: Jiawei Zhao Date: Sat, 13 Jan 2024 22:34:39 +0800 Subject: [PATCH] ci: add basic ci workflow Signed-off-by: Jiawei Zhao --- .github/workflows/ci.yaml | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b016188 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,67 @@ +name: CI + +on: + schedule: + - cron: '0 0 * * *' + pull_request: + branches: [dev] + +jobs: + format: + name: Format + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Format code + uses: iamnotaturtle/auto-gofmt@v2.1.0 + with: + only_changed: True + + lint: + name: Lint Check + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54.2 + + test: + name: Doris Operator Test + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Run tests + run: make test + + spell-check: + name: Spell Check + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Spelling Check + uses: crate-ci/typos@master \ No newline at end of file