Skip to content

Commit

Permalink
Merge pull request #366 from mineadmin/master
Browse files Browse the repository at this point in the history
Merge master
  • Loading branch information
zds-s authored Oct 23, 2024
2 parents 4ed0d0b + 9255dfc commit a861054
Show file tree
Hide file tree
Showing 185 changed files with 9,438 additions and 1,346 deletions.
28 changes: 14 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ APP_NAME=skeleton
APP_ENV=dev

DB_DRIVER=mysql
DB_HOST=localhost
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=mine
DB_USERNAME=root
DB_PASSWORD=root
DB_PASSWORD=123456
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=

REDIS_HOST=localhost
REDIS_HOST=redis
REDIS_AUTH=
REDIS_PORT=6379
REDIS_DB=0

AMQP_HOST = 127.0.0.1
AMQP_PORT = 5672
AMQP_USER = guest
AMQP_PASSWORD = guest
AMQP_VHOST = /
AMQP_ENABLE = false
AMQP_HOST=rabbitmq
AMQP_PORT=5672
AMQP_USER=mineadmin
AMQP_PASSWORD=123456
AMQP_VHOST=/
AMQP_ENABLE=false

SUPER_ADMIN = 1000
ADMIN_ROLE = 1000
CONSOLE_SQL = true
JWT_SECRET = abcdefg
JWT_API_SECRET = 654321
CONSOLE_SQL=true
JWT_SECRET=azOVxsOWt3r0ozZNz8Ss429ht0T8z6OpeIJAIwNp6X0xqrbEY2epfIWyxtC1qSNM8eD6/LQ/SahcQi2ByXa/2A==
JWT_API_SECRET=ISfQtGMNRtGopgzfxxS9A3d7kpBxknf74gVrFHnpPTzkzI2+80l+NmznOkOQLSpMt7Xw9YVvQUZlBaQVMDDMQQ==

SUPER_ADMIN=1
25 changes: 25 additions & 0 deletions .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
labelPRBasedOnFilePath:
Setting:
- app/Setting/**/*
System:
- app/System/**/*
UnitTest:
- test/**/*
ChangeLog:
- CHANGELOG-*.md
Composer:
- composer.json
- src/*/composer.json

firstPRWelcomeComment: >
Thanks for opening this pull request! Please check out our [contributing guidelines](https://github.com/mineadmin/MineAdmin/blob/master/CONTRIBUTING.md).
感谢您开启此拉取请求!请查看我们的 [贡献者指南](https://github.com/mineadmin/MineAdmin/blob/master/CONTRIBUTING.md#L51)。
# Comment to be posted to congratulate user on their first merged PR
firstPRMergeComment: >
Awesome work, congrats on your first merged pull request!
祝贺你的第一个拉取请求被合并!
# Comment to be posted to on first time issues
firstIssueWelcomeComment: >
Thanks for opening your first issue here! Be sure to follow the issue template!
感谢您在这里反馈第一个问题!请务必遵循问题模板!
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
6 changes: 6 additions & 0 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so

WORKDIR /opt/www

COPY . /opt/www

RUN composer install --no-dev -o && php bin/hyperf.php

EXPOSE 9501 9502 9503

ENTRYPOINT ["php", "/opt/www/bin/hyperf.php", "start"]
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker:latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build
run: cp -rf .github/workflows/Dockerfile . && docker build -t hyperf .
run: docker build -t hyperf .
- name: docker-compose
run:
docker-compose up -d
85 changes: 85 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Code Coverage Upload

on:
push:
pull_request:
schedule:
- cron: '0 2 * * *'

jobs:
tests:
name: build Code coverage report
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.1' ]
sw-version: [ 'v5.1.2']
exclude:
- php-version: '8.3'
sw-version: 'v5.0.3'
max-parallel: 20
fail-fast: false
env:
SW_VERSION: ${{ matrix.sw-version }}
MYSQL_VERSION: '8.0'
PGSQL_VERSION: '14'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upgrade
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -f
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpize
extensions: redis, pdo, pdo_mysql, bcmath
ini-values: opcache.enable_cli=0
coverage: xdebug
- name: Setup Swoole
run: |
sudo apt-get install libcurl4-openssl-dev libc-ares-dev libpq-dev
wget https://github.com/swoole/swoole-src/archive/${SW_VERSION}.tar.gz -O swoole.tar.gz
mkdir -p swoole
tar -xf swoole.tar.gz -C swoole --strip-components=1
rm swoole.tar.gz
cd swoole
phpize
./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli
make -j$(nproc)
sudo make install
sudo sh -c "echo extension=swoole > /etc/php/${{ matrix.php-version }}/cli/conf.d/swoole.ini"
sudo sh -c "echo swoole.use_shortname='Off' >> /etc/php/${{ matrix.php-version }}/cli/conf.d/swoole.ini"
php --ri swoole
php --ri xdebug
- name: Setup Packages
run: ./.travis/requirement.install.sh
- name: Run PHPStan
run: ./.travis/run.check.sh
- name: Setup Services
run: ./.travis/setup.services.sh
- name: Setup Mysql
run: export TRAVIS_BUILD_DIR=$(pwd) && bash ./.travis/setup.mysql.sh
- name: Setup PostgreSQL
run: export TRAVIS_BUILD_DIR=$(pwd) && bash ./.travis/setup.pgsql.sh
- name: Run Scripts Before Test
run: cp .travis/.env.example .env
- name: Print PHP Environments
run: |
php -i
php -m
- name: Run Mysql Test Cases
env:
DB_DRIVER: mysql
DB_HOST: 127.0.0.1
DB_DATABASE: mineadmin
run: ./.travis/run.code-coverage.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4-beta
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: "./tests/coverage.xml"
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:

name: Release

permissions: write-all

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/sync-gitee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Sync Gitee Repository

on:
schedule:
- cron: '* 1 * * *'

jobs:
sync:
runs-on: ubuntu-latest
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Private Key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "StrictHostKeyChecking no" >> ~/.ssh/config
- name: Push Mirror
env:
SOURCE_REPO: 'https://github.com/mineadmin/mineadmin.git'
DESTINATION_REPO: '[email protected]:mineadmin/mineadmin.git'
run: |
git clone --mirror "$SOURCE_REPO" && cd `basename "$SOURCE_REPO"`
git remote set-url --push origin "$DESTINATION_REPO"
git fetch -p origin
git for-each-ref --format 'delete %(refname)' refs/pull | git update-ref --stdin
git push --mirror
Loading

0 comments on commit a861054

Please sign in to comment.