Skip to content

Commit

Permalink
Merge pull request #349 from mineadmin/3.x-develop
Browse files Browse the repository at this point in the history
3.x develop
  • Loading branch information
zds-s authored Oct 3, 2024
2 parents 854d393 + 173baa7 commit bd84f88
Show file tree
Hide file tree
Showing 633 changed files with 37,629 additions and 15,352 deletions.
40 changes: 40 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Setup Node"

description: "Setup node and pnpm"

runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: "pnpm"

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
if: ${{ github.ref_name == 'master' }}
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache/restore@v4
if: ${{ github.ref_name != 'master' }}
with:
path: ${{ env.STORE_PATH }}
key: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
Empty file modified .github/ci/requirement.install.sh
100755 → 100644
Empty file.
Empty file modified .github/ci/run.check.sh
100755 → 100644
Empty file.
Empty file modified .github/ci/run.code-coverage.sh
100755 → 100644
Empty file.
Empty file modified .github/ci/run.test.sh
100755 → 100644
Empty file.
Empty file modified .github/ci/setup.mysql.sh
100755 → 100644
Empty file.
Empty file modified .github/ci/setup.pgsql.sh
100755 → 100644
Empty file.
Empty file modified .github/ci/setup.services.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ RUN composer install --no-dev -o && php bin/hyperf.php

EXPOSE 9501 9502 9503

ENTRYPOINT ["php", "/opt/www/bin/hyperf.php", "start"]
ENTRYPOINT ["php", "/opt/www/mine", "start"]
95 changes: 95 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

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

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Fetch just the latest commit so that we can determine which files were changed
fetch-depth: 0
path: web

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
124 changes: 124 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: CI

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

permissions:
contents: read

env:
CI: true
TZ: Asia/Shanghai

jobs:
test:
name: Test
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: web

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Setup Node
uses: ./.github/actions/setup-node

# - name: Check Git version
# run: git --version

# - name: Setup mock Git user
# run: git config --global user.email "[email protected]" && git config --global user.name "Your Name"

- name: Vitest tests
run: pnpm run test:unit

# - name: Upload coverage
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

lint:
name: Lint
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: ./.github/actions/setup-node

- name: Lint
run: pnpm run lint

check:
name: Check
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: ./.github/actions/setup-node

- name: Typecheck
run: pnpm check:type

# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: Check workflow files
if: runner.os == 'Linux'
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=""
ci-ok:
name: CI OK
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && always()
needs: [test, check, lint]
env:
FAILURE: ${{ contains(join(needs.*.result, ','), 'failure') }}
steps:
- name: Check for failure
run: |
echo $FAILURE
if [ "$FAILURE" = "false" ]; then
exit 0
else
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ tests/coverage.xml
tests/coding_standard.xml
tests/junit.xml
public
!web/public
*.lock
11 changes: 11 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
->setParallelConfig(new PhpCsFixer\Runner\Parallel\ParallelConfig(8, 24))
->setRules([
'@PSR2' => true,
'@PhpCsFixer:risky' => true,
'@PSR12' => true,
'@PER-CS2.0' => true,
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'@Symfony:risky' => true,
'@PhpCsFixer' => true,
'@PHP81Migration' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
Expand Down Expand Up @@ -81,6 +86,12 @@
'single_quote' => true,
'standardize_not_equals' => true,
'multiline_comment_opening_closing' => true,
'mb_str_functions' => true,
'set_type_to_cast' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'normalize_index_brace' => true,
'return_to_yield_from' => true,
'class_keyword' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
Expand Down
13 changes: 0 additions & 13 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,4 @@
override(\Hyperf\Support\make(0), map(['' => '@']));
override(\Hyperf\Support\optional(0), type(0));
override(\Hyperf\Tappable\tap(0), type(0));
}

namespace Hyperf\Database\Model{
class Builder{
/**
* @param int|null $userid
* @return Builder
*/
public function userDataScope(?int $userid = null)
{

}
}
}
32 changes: 0 additions & 32 deletions app/Async/Crontab/ClearLogCrontab.php

This file was deleted.

Loading

0 comments on commit bd84f88

Please sign in to comment.