@@ -12,14 +12,17 @@ jobs:
1212 eslint :
1313 name : ESLint
1414 runs-on : ubuntu-latest
15+ env :
16+ CI : 1
17+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
1518 steps :
1619 - uses : actions/checkout@v1
1720 with :
18- fetch-depth : 2
19- - name : Install Package dependencies
20- run : composer prepare:js
21+ fetch-depth : 3
22+ - name : Prepare setting
23+ run : git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
2124 - name : Check code style
22- run : composer eslint
25+ run : bash travis-ci/bin/js/js-lint.sh
2326 - uses : 8398a7/action-slack@v1
2427 with :
2528 type : failure
@@ -30,19 +33,17 @@ jobs:
3033 phpcs :
3134 name : PHP Code Sniffer
3235 runs-on : ubuntu-latest
36+ env :
37+ CI : 1
38+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
3339 steps :
3440 - uses : actions/checkout@v1
3541 with :
36- fetch-depth : 2
42+ fetch-depth : 3
3743 - name : Prepare setting
3844 run : git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
39- env :
40- CI : 1
41- TRAVIS_BUILD_DIR : ${{ github.workspace }}
42- - name : Install Composer dependencies
43- run : composer prepare:php
4445 - name : Check code style
45- run : composer phpcs
46+ run : bash travis-ci/bin/php/ phpcs.sh
4647 - uses : 8398a7/action-slack@v1
4748 with :
4849 type : failure
@@ -53,19 +54,17 @@ jobs:
5354 phpmd :
5455 name : PHPMD
5556 runs-on : ubuntu-latest
57+ env :
58+ CI : 1
59+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
5660 steps :
5761 - uses : actions/checkout@v1
5862 with :
59- fetch-depth : 2
63+ fetch-depth : 3
6064 - name : Prepare setting
6165 run : git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
62- env :
63- CI : 1
64- TRAVIS_BUILD_DIR : ${{ github.workspace }}
65- - name : Install Composer dependencies
66- run : composer prepare:php
6766 - name : Check code style
68- run : composer phpmd
67+ run : bash travis-ci/bin/php/ phpmd.sh
6968 - uses : 8398a7/action-slack@v1
7069 with :
7170 type : failure
@@ -78,14 +77,30 @@ jobs:
7877 name : Jest
7978 needs : eslint
8079 runs-on : ubuntu-latest
80+ strategy :
81+ matrix :
82+ node : ['8', '10', '11', '12']
83+ env :
84+ CI : 1
85+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
8186 steps :
8287 - uses : actions/checkout@v1
8388 with :
84- fetch-depth : 2
85- - name : Install Package dependencies
86- run : composer prepare:js
89+ fetch-depth : 3
90+ - name : Setup node
91+ uses : actions/setup-node@v1
92+ with :
93+ node-version : ${{ matrix.node }}
94+ - name : Prepare setting
95+ run : git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
8796 - name : Run tests
88- run : composer jest
97+ run : bash travis-ci/bin/js/js-test.sh
98+ - name : Codecov
99+ run : curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
100+ env :
101+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
102+ COVERAGE_FILE : ./assets/js/coverage/lcov.info
103+ if : matrix.node == '12'
89104 - uses : 8398a7/action-slack@v1
90105 with :
91106 type : failure
97112 name : PHPUnit
98113 needs : [phpcs, phpmd]
99114 runs-on : ubuntu-16.04
115+ env :
116+ CI : 1
117+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
100118 services :
101119 mysql :
102120 image : mysql
@@ -118,27 +136,30 @@ jobs:
118136 steps :
119137 - uses : actions/checkout@v1
120138 with :
121- fetch-depth : 2
139+ fetch-depth : 3
122140 - name : Switch PHP version
123141 env :
124142 PHP_VERSION : ${{ matrix.php }}
125143 run : sudo ln -sf "/usr/bin/php$PHP_VERSION" /etc/alternatives/php
126144 - name : Prepare setting
127145 run : git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
128146 env :
129- CI : 1
130- TRAVIS_BUILD_DIR : ${{ github.workspace }}
131147 WP_VERSION : ${{ matrix.WP_VERSION }}
148+ WP_MULTISITE : ${{ matrix.WP_MULTISITE }}
132149 ACTIVATE_POPULAR_PLUGINS : ${{ matrix.ACTIVATE_POPULAR_PLUGINS }}
133150 - name : Run tests
134151 run : bash travis-ci/bin/php/wp-test.sh
135152 env :
136- CI : 1
137153 DB_PASS : root
138- TRAVIS_BUILD_DIR : ${{ github.workspace }}
139154 WP_VERSION : ${{ matrix.WP_VERSION }}
140155 WP_MULTISITE : ${{ matrix.WP_MULTISITE }}
141156 ACTIVATE_POPULAR_PLUGINS : ${{ matrix.ACTIVATE_POPULAR_PLUGINS }}
157+ - name : Codecov
158+ run : curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
159+ env :
160+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
161+ COVERAGE_FILE : ./coverage/clover.xml
162+ if : matrix.ACTIVATE_POPULAR_PLUGINS == 1
142163 - uses : 8398a7/action-slack@v1
143164 with :
144165 type : failure
0 commit comments