Skip to content

Commit

Permalink
Merge branch 'gogf:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
danvinhe authored Apr 23, 2022
2 parents ab139f9 + be77779 commit 688171a
Show file tree
Hide file tree
Showing 717 changed files with 30,341 additions and 10,503 deletions.
9 changes: 3 additions & 6 deletions .github/ISSUE_TEMPLATE.MD
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<!-- Please answer these questions before submitting your issue. Thanks! -->

<!-- 为高效处理您的疑问,如果觉得是BUG类问题,请您务必提供可复现该问题的最小可运行代码! -->
<!-- 为高效处理您的疑问,如果觉得是BUG类问题,请您务必提供可复现该问题的最小可运行代码! -->
<!-- 为高效处理您的疑问,如果觉得是BUG类问题,请您务必提供可复现该问题的最小可运行代码! -->
<!-- 为高效处理您的疑问,如果觉得是BUG类问题,请您务必提供可复现该问题的最小可运行代码!否则issue可能会被延期处理! -->
<!-- 为高效处理您的疑问,如果觉得是BUG类问题,请您务必提供可复现该问题的最小可运行代码!否则issue可能会被延期处理! -->
<!-- 为高效处理您的疑问,如果觉得是BUG类问题,请您务必提供可复现该问题的最小可运行代码!否则issue可能会被延期处理! -->
<!-- 重要的事情说三遍! -->

### 1. What version of `Go` and system type/arch are you using?

<!--
Please paste the output of command `go version` from your terminal.
What expect to see is like: `go 1.12, linux/amd64`
-->


### 2. What version of `GoFrame` are you using?

<!-- You can find the GF version from your `go.mod`, or from the `version.go` in `GF` -->


Expand All @@ -23,7 +21,6 @@ What expect to see is like: `go 1.12, linux/amd64`


### 4. What did you do?

<!--
If possible, provide a copy of shortest codes for reproducing the error.
A complete runnable program is best.
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: GoFrame CLI Build Release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
TZ: Asia/Shanghai


jobs:
build:
name: Build And Release
runs-on: ubuntu-latest
steps:
- name: Checkout Github Code
uses: actions/checkout@v2

- name: Set Up Golang Environment
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Build CLI Binary
run: |
echo "Building linux amd64 binary..."
cd cmd/gf
GOOS=linux GOARCH=amd64 go build main.go
chmod +x main
./main install -y
- name: Build CLI Binary For All Platform
run: |
cd cmd/gf
gf build main.go -n gf -a all -s all
- name: Move Files Before Release
run: |
cd cmd/gf/temp
for OS in *;do for FILE in $OS/*;\
do if [[ ${OS} =~ 'windows' ]];\
then mv $FILE gf_$OS.exe && rm -rf $OS;\
else mv $FILE gf_$OS && rm -rf $OS;\
fi;done;done
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: GoFrame CLI Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["cmd/gf/temp/gf_*"]'
156 changes: 156 additions & 0 deletions .github/workflows/gf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: GoFrame Main CI


on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop


env:
GF_DEBUG: 0


jobs:
code-test:
runs-on: ubuntu-latest


# Service containers to run with `code-test`
services:
redis:
image : redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 6379 on service container to the host
- 6379:6379

mysql:
image: mysql:5.7
env:
MYSQL_DATABASE : test
MYSQL_ROOT_PASSWORD: 12345678
ports:
# Maps tcp port 3306 on service container to the host
- 3306:3306

postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: 12345678
POSTGRES_USER: root
POSTGRES_DB: test
TZ: Asia/Shanghai
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mssql:
image: mcmoe/mssqldocker:latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: LoremIpsum86
MSSQL_DB: test
MSSQL_USER: root
MSSQL_PASSWORD: LoremIpsum86
ports:
- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P LoremIpsum86 -l 30 -Q \"SELECT 1\" || exit 1"
--health-start-period 10s
--health-interval 10s
--health-timeout 5s
--health-retries 10
clickhouse-server:
image: yandex/clickhouse-server
ports:
- 9000:9000
- 8123:8123
- 9001:9001


# strategy set
strategy:
matrix:
go: ["1.15", "1.16", "1.17"]


steps:
- name: Set Up Timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Shanghai"

- name: Checkout Repository
uses: actions/checkout@v2

- name: Set Up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Before Script
run: |
find . -name "*.go" | xargs gofmt -w
git diff --name-only --exit-code || if [ $? != 0 ]; then echo "Notice: gofmt check failed,please gofmt before pr." && exit 1; fi
echo "gofmt check pass."
sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts
- name: CLI Build & Test
run: |
cd cmd/gf
go mod tidy
go build ./...
go test ./...
- name: Example Build & Test
run: |
cd example
go mod tidy
go build ./...
go test ./...
- name: Contrib Build & Test
run: |
cd contrib
for file in `find . -name go.mod`; do
path=$(dirname $file)
# Ignore oracle database driver build&test.
if [ "oracle" = $(basename $path) ]; then
continue 1
fi
cd $path
go mod tidy
go build ./...
go test ./...
cd -
done
- name: Run i386 Arch Test
run: |
GOARCH=386 go test -v ./... || exit 1
- name: Run amd64 Arch Test
run: |
GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Report Coverage
uses: codecov/codecov-action@v2
with:
flags: go-${{ matrix.go }}

74 changes: 0 additions & 74 deletions .github/workflows/go.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: GoFrame AutoCreating SubMod Tags

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
TZ: Asia/Shanghai
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


jobs:
build:
name: Auto Creating Tags
runs-on: ubuntu-latest
steps:
- name: Checkout Github Code
uses: actions/checkout@v2

- name: Auto Creating Tags
run: |
git config --global user.email "[email protected]"
git config --global user.name "TagRobot"
for file in `find contrib -name go.mod`; do
tag=$(dirname $file)/$GITHUB_REF_NAME
git tag $tag
git push origin $tag
done
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pkg/
bin/
cbuild
**/.DS_Store
.vscode/
.test/
main
gf
Loading

0 comments on commit 688171a

Please sign in to comment.