File tree Expand file tree Collapse file tree 3 files changed +20
-72
lines changed Expand file tree Collapse file tree 3 files changed +20
-72
lines changed Original file line number Diff line number Diff line change 1
- # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name : Node.js CI
1
+ name : CI
5
2
6
3
on :
7
4
push :
8
- branches :
9
- - main
10
- - master
11
- pull_request :
12
- branches :
13
- - main
14
- - master
15
- schedule :
16
- - cron : ' 0 2 * * *'
17
-
18
- jobs :
19
- build :
20
- runs-on : ${{ matrix.os }}
21
-
22
- services :
23
- mysql :
24
- image : mysql:5
25
- env :
26
- MYSQL_ALLOW_EMPTY_PASSWORD : true
27
- MYSQL_DATABASE : test
28
- ports :
29
- - 3306:3306
30
- options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
5
+ branches : [ master ]
31
6
32
- strategy :
33
- fail-fast : false
34
- matrix :
35
- node-version : [14, 16, 18]
36
- os : [ubuntu-latest]
37
-
38
- steps :
39
- - name : Checkout Git Source
40
- uses : actions/checkout@v2
41
-
42
- - name : Use Node.js ${{ matrix.node-version }}
43
- uses : actions/setup-node@v3
44
- with :
45
- node-version : ${{ matrix.node-version }}
46
-
47
- - name : Install Dependencies
48
- run : npm i
7
+ pull_request :
8
+ branches : [ master ]
49
9
50
- - name : Continuous Integration
51
- run : npm run ci
10
+ workflow_dispatch : {}
52
11
53
- - name : Code Coverage
54
- uses : codecov/codecov-action@v3
55
- with :
56
- token : ${{ secrets.CODECOV_TOKEN }}
12
+ jobs :
13
+ Job :
14
+ name : Node.js
15
+ uses : fengmk2/github-actions/.github/workflows/node-test-mysql.yml@master
16
+ with :
17
+ os : ' ubuntu-latest'
18
+ version : ' 14, 16, 18'
Original file line number Diff line number Diff line change 23
23
"ali-rds" : " ^4.0.1"
24
24
},
25
25
"devDependencies" : {
26
- "egg" : " ^3.5.0" ,
27
- "egg-bin" : " ^5.5.0" ,
28
- "egg-ci" : " ^2.1.0" ,
29
- "egg-mock" : " ^5.2.1" ,
26
+ "egg" : " ^3.15.0" ,
27
+ "egg-bin" : " ^6.1.2" ,
28
+ "egg-mock" : " ^5.10.6" ,
30
29
"eslint" : " ^8.16.0" ,
31
30
"eslint-config-egg" : " ^12.1.0" ,
32
- "git-contributor" : " ^1.0.10" ,
33
- "tsd" : " ^0.25.0" ,
34
- "utility" : " ^1.17.0"
31
+ "git-contributor" : " ^2.0.0" ,
32
+ "tsd" : " ^0.25.0"
35
33
},
36
34
"engines" : {
37
35
"node" : " >=14.0.0"
45
43
"lint" : " eslint ." ,
46
44
"ci" : " npm run lint && npm run cov"
47
45
},
48
- "ci" : {
49
- "version" : " 14, 16, 18" ,
50
- "license" : true ,
51
- "service" : {
52
- "mysql" : {
53
- "version" : " 5" ,
54
- "db" : " test"
55
- }
56
- }
57
- },
58
46
"repository" : {
59
47
"type" : " git" ,
60
48
"url" : " git+https://github.com/eggjs/egg-mysql.git"
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
const assert = require ( 'assert' ) ;
4
- const mm = require ( 'egg-mock' ) ;
5
- const utility = require ( 'utility' ) ;
2
+ const { randomUUID } = require ( 'crypto' ) ;
6
3
const path = require ( 'path' ) ;
7
4
const fs = require ( 'fs' ) ;
5
+ const mm = require ( 'egg-mock' ) ;
8
6
9
7
describe ( 'test/mysql.test.js' , ( ) => {
10
8
let app ;
11
- const uid = utility . randomString ( ) ;
9
+ const uid = randomUUID ( ) ;
12
10
13
11
before ( ( ) => {
14
12
app = mm . app ( {
You can’t perform that action at this time.
0 commit comments