Skip to content

Commit 2dc732e

Browse files
authored
Removing Meaningless Test Processes (#265)
* Removing Meaningless Test Processes * Add closure reason comment * Remove Crontab unit test * Add automatic code formatting tool * Update test.yml * Update test.yml * Update test.yml * Update test.yml * Update pull-request-cs-fixer * Added crontab-cs-fixer
1 parent 87b8a0b commit 2dc732e

File tree

4 files changed

+86
-117
lines changed

4 files changed

+86
-117
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Pull Request CS Fixer
2+
on:
3+
schedule:
4+
- cron: '0 2 * * *'
5+
6+
jobs:
7+
cs-fix:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
strategy:
12+
matrix:
13+
os: [ ubuntu-latest ]
14+
php: [ '8.1' ]
15+
swoole: [ 'swoole' ]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
extensions: redis,pdo,pdo_mysql,bcmatch,${{ matrix.swoole }}
22+
- name: Setup Packages
23+
run: composer update -oW
24+
- name: Run CS Fix
25+
run: |
26+
vendor/bin/php-cs-fixer fix app
27+
vendor/bin/php-cs-fixer fix api
28+
- uses: EndBug/add-and-commit@v9
29+
with:
30+
add: '-A'
31+
author_name: StyleCI
32+
author_email: [email protected]
33+
message: 'Apply CS Fixer'
34+
push: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Pull Request CS Fixer
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
cs-fix:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
strategy:
11+
matrix:
12+
os: [ ubuntu-latest ]
13+
php: [ '8.1' ]
14+
swoole: [ 'swoole' ]
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
repository: ${{ github.event.pull_request.head.repo.full_name }}
19+
ref: ${{ github.event.pull_request.head.ref }}
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
extensions: redis,pdo,pdo_mysql,bcmatch,${{ matrix.swoole }}
24+
- name: Setup Packages
25+
run: composer update -oW
26+
- name: Run CS Fix
27+
run: |
28+
vendor/bin/php-cs-fixer fix app
29+
vendor/bin/php-cs-fixer fix api
30+
- uses: EndBug/add-and-commit@v9
31+
with:
32+
add: '-A'
33+
author_name: StyleCI
34+
author_email: [email protected]
35+
message: 'Apply CS Fixer'
36+
push: true

.github/workflows/test.yml

+16-41
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,11 @@
11
name: MineAdmin Unit and Ci Test
2-
32
on:
43
push:
54
pull_request:
65
schedule:
76
- cron: '0 2 * * *'
8-
97
jobs:
10-
cs-fix:
11-
name: PHP CS Fix on PHP${{ matrix.php }} ${{ matrix.swoole }}
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
os: [ ubuntu-latest ]
16-
php: [ '8.1','8.2','8.3' ]
17-
swoole: [ 'swoole']
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
tools: php-cs-fixer
25-
extensions: redis, pdo, pdo_mysql,bcmath, ${{ matrix.swoole }}
26-
- name: Setup Packages
27-
run: composer update -oW
28-
29-
- name: Run CS Fix
30-
run: |
31-
vendor/bin/php-cs-fixer fix app --dry-run --diff
32-
vendor/bin/php-cs-fixer fix api --dry-run --diff
338
tests:
34-
needs: cs-fix
359
name: Test on PHP${{ matrix.php-version }} Swoole-${{ matrix.sw-version }}
3610
runs-on: "${{ matrix.os }}"
3711
strategy:
@@ -131,18 +105,19 @@ jobs:
131105
DB_CHARSET: utf8
132106
DB_DATABASE: mineadmin
133107
run: ./.travis/run.test.sh
134-
- name: Run MsSql Test Cases
135-
if: matrix.sw-version != 'v5.0.3'
136-
env:
137-
DB_DRIVER: sqlsrv
138-
DB_HOST: mssql
139-
DB_PORT: 1433
140-
DB_USERNAME: SA
141-
DB_PASSWORD: mineadmin123,./
142-
DB_CHARSET: utf8
143-
DB_DATABASE: mineadmin
144-
ODBC_ENABLE: true
145-
ODBC_DSN: "DRIVER={ODBC Driver 18 for SQL Server};SERVER=127.0.0.1,1433;TrustServerCertificate=yes;database=mineadmin"
146-
run: |
147-
composer require hyperf/database-sqlserver-incubator:dev-main
148-
./.travis/run.test.sh
108+
# 因为 mssql 依赖现在有问题,暂时未修复。等修复后再开启
109+
# - name: Run MsSql Test Cases
110+
# if: matrix.sw-version != 'v5.0.3'
111+
# env:
112+
# DB_DRIVER: sqlsrv
113+
# DB_HOST: mssql
114+
# DB_PORT: 1433
115+
# DB_USERNAME: SA
116+
# DB_PASSWORD: mineadmin123,./
117+
# DB_CHARSET: utf8
118+
# DB_DATABASE: mineadmin
119+
# ODBC_ENABLE: true
120+
# ODBC_DSN: "DRIVER={ODBC Driver 18 for SQL Server};SERVER=127.0.0.1,1433;TrustServerCertificate=yes;database=mineadmin"
121+
# run: |
122+
# composer require hyperf/database-sqlserver-incubator:dev-main
123+
# ./.travis/run.test.sh

tests/Feature/ModuleTest/Setting/Tools/CrontabTest.php

-76
This file was deleted.

0 commit comments

Comments
 (0)