-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gogf:master' into master
- Loading branch information
Showing
717 changed files
with
30,341 additions
and
10,503 deletions.
There are no files selected for viewing
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
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
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_*"]' |
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
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 }} | ||
|
This file was deleted.
Oops, something went wrong.
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
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ pkg/ | |
bin/ | ||
cbuild | ||
**/.DS_Store | ||
.vscode/ | ||
.test/ | ||
main | ||
gf |
Oops, something went wrong.