Skip to content

Commit

Permalink
Merge pull request #265 from XiaoMi/github-master
Browse files Browse the repository at this point in the history
Gaea 2.4.2 Synchronization
  • Loading branch information
gongna-au authored Sep 20, 2024
2 parents de11b22 + 9c02296 commit 76b0117
Show file tree
Hide file tree
Showing 384 changed files with 39,422 additions and 10,170 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/auto-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: Auto Comment

on:
issues:
types: [opened] # 触发条件:当问题被创建时
pull_request:
types: [opened] # 触发条件:当拉取请求被创建时

permissions:
issues: write # 允许写入问题
pull-requests: write # 允许写入拉取请求

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on issue
uses: actions/github-script@v4
with:
script: |
const issueOpened = "Thank you for raising an issue. We will try and get back to you as soon as possible. Please make sure you have given us as much context as possible.";
const pullRequestOpened = "Thank you for raising your pull request. Please make sure you have followed our contributing guidelines. We will review it as soon as possible.";
if (context.payload.action === 'opened') {
const issueComment = context.payload.issue ? issueOpened : pullRequestOpened;
await github.issues.createComment({
...context.repo,
issue_number: context.payload.issue ? context.payload.issue.number : context.payload.pull_request.number,
body: issueComment
});
}
110 changes: 110 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Go

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
code_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.16'

- name: Run code check
run: |
# 执行所有检查
for check in EOF spelling; do
./hack/verify-$check.sh
done
parser_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.16'

- name: Build parser
run: |
cd parser && make
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.16'

- name: Set timezone
run: |
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ls -l /etc/localtime
- name: Run unit tests
run: |
make test
echo "sql parser test"
cd parser && make test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.16'

- name: Build the project
run: |
make build
e2e_test_mysql5:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Pull Docker image
run: |
docker pull fieelina/gaea-test-amd64:v2.4 # 确认这个镜像是可用的
- name: Run Mysql5 E2E tests
run: |
docker run --rm \
-v $(pwd):/workspace \
-w /workspace \
fieelina/gaea-test-amd64:v2.4 \
make e2e-test
e2e_test_mysql8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Pull Docker image
run: |
docker pull fieelina/gaea-test-amd64-mysql8:v2.4 # 确认这个镜像是可用的
- name: Run Mysql8 E2E tests
run: |
docker run --rm \
-v $(pwd):/workspace \
-w /workspace \
fieelina/gaea-test-amd64-mysql8:v2.4 \
make e2e-test-mysql8
36 changes: 36 additions & 0 deletions .github/workflows/linelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: Linelint

on:
push:
pull_request:

jobs:
linelint:
runs-on: ubuntu-latest
name: Check if all files end in newline

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Linelint
uses: fernandrone/[email protected]
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ bin
logs
.coverage.*
.vscode
.idea
.idea
tests/e2e/cmd/logs
tests/e2e/cmd/gaea
tests/e2e/cmd/gaea-cc
.DS_Store
.integrate_coverage.func
.integrate_coverage.html
.integrate_coverage.out
.coverage.*
32 changes: 32 additions & 0 deletions .gitlab/merge_request_templates/mr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### What problem does this PR solve?

Issue Number: None

Problem Summary:

### What is changed and how it works?

### Check List

- [ ] Unit test
- [ ] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No code

Side effects

- [ ] Breaking backward compatibility
- [ ] Config file changes

Documentation

- [ ] Affects user behaviors
- [ ] Contains syntax changes
- [ ] Contains variable changes
- [ ] Changes MySQL compatibility

### Release note

```release-note
None
```
20 changes: 20 additions & 0 deletions .linelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 'true' will fix files
autofix: false

# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
ignore:
- tests/e2e/shard/case/join/mycat/long/unsupport.sql
- tests/e2e/shard/case/join/mycat/mod/unsupport.sql
- tests/e2e/shard/case/join/mycat/murmur/unsupport.sql
- tests/e2e/shard/case/join/mycat/string/unsupport.sql
rules:
# checks if file ends in a newline character
end-of-file:
# set to true to enable this rule
enable: true

# set to true to disable autofix (if enabled globally)
disable-autofix: false

# if true also checks if file ends in a single newline character
single-new-line: true
Loading

0 comments on commit 76b0117

Please sign in to comment.