Skip to content

Commit a47e3e0

Browse files
authored
Merge pull request #85 from material-components/release/0.2.0
Release 0.2.0
2 parents e22c27f + ee32d8e commit a47e3e0

File tree

914 files changed

+44846
-197244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

914 files changed

+44846
-197244
lines changed

.coveralls.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
service_name: travis-ci
16-
coverage_clover: build/logs/clover.xml
17-
json_path: build/logs/coveralls-upload.json
15+
coverage_clover: plugin/tests/coverage/clover.xml
16+
json_path: plugin/tests/coverage/coveralls-upload.json

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
**/bin/**
33
**/node_modules/**
44
**/vendor/**
5-
**/assets/js/*.js
5+
**/plugin/assets/js/*.js
6+
**/theme/assets/js/*.js
67
build/*
78
built/*

.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"**/__tests__/**/*.js",
99
"**/test/*.js",
1010
"**/?(*.)test.js",
11-
"tests/js/**/*.js"
11+
"**/tests/js/**/*.js"
1212
],
1313
"extends": [
1414
"plugin:jest/all"

.github/PULL_REQUEST_TEMPLATE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Fixes #
55

66
## Checklist
77

8-
- [ ] My pull request is addressing an [open issue](https://github.com/xwp/material-design-wp-plugin/issues) (please create one otherwise).
9-
- [ ] My code is tested and passes existing [tests](https://github.com/xwp/material-design-wp-plugin/contributing.md#scripts).
10-
- [ ] My code follows the [Contributing Guidelines](https://github.com/xwp/material-design-wp-plugin/contributing.md) (updates are often made to the guidelines, check it out periodically).
8+
- [ ] My pull request is addressing an [open issue](https://github.com/material-components/material-design-for-wordpress/issues) (please create one otherwise).
9+
- [ ] My code is tested and passes existing [tests](https://github.com/material-components/material-design-for-wordpress/contributing.md#scripts).
10+
- [ ] My code follows the [Contributing Guidelines](https://github.com/material-components/material-design-for-wordpress/contributing.md) (updates are often made to the guidelines, check it out periodically).

.github/workflows/lint-tests.yml

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: Coding Standards and Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
10+
jobs:
11+
lint:
12+
name: "Coding Standards"
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: "14"
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run coding standards check
25+
run: npm run lint
26+
27+
test-e2e:
28+
needs: [lint]
29+
name: "E2E tests (PHP ${{ matrix.php_versions }}, WordPress ${{ matrix.wp_versions }})"
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
php_versions: [7.4]
36+
wp_versions: [5.7]
37+
include:
38+
- php_versions: 7.3
39+
wp_versions: 5.2
40+
41+
env:
42+
NODE_ENV: teste2e
43+
WP_VERSION: ${{ matrix.wp_versions }}
44+
PHP_VERSION: php${{ matrix.php_versions }}-apache
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: hmarr/debug-action@v2
49+
- uses: actions/setup-node@v1
50+
with:
51+
node-version: "14"
52+
53+
- name: Install dependencies
54+
run: npm ci
55+
56+
- name: Build assets
57+
run: npm run build:js
58+
59+
- name: Sleep for 10 seconds
60+
uses: jakejarvis/wait-action@master
61+
with:
62+
time: '10s'
63+
64+
- name: Start docker local env
65+
run: |
66+
npm run env:start
67+
docker-compose exec -T wordpress bash -c "chown -R www-data:www-data /var/www/html/wp-content/" # ensure WP folders have correct permissions
68+
docker-compose exec -T mysql bash -c "chown -R mysql:mysql /var/lib/mysql"
69+
70+
- name: Docker containers debug information
71+
run: |
72+
docker ps -a
73+
74+
- name: Sleep for 10 seconds
75+
uses: jakejarvis/wait-action@master
76+
with:
77+
time: '10s'
78+
79+
- name: Install WordPress
80+
run: |
81+
npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password [email protected] --skip-email --url=http://localhost:8088 --quiet
82+
npm run wp -- wp plugin activate material-design
83+
84+
- name: Run E2E tests
85+
if: ${{ matrix.wp_versions == '5.2' }}
86+
run: npm run test:e2e
87+
88+
- name: Run E2E tests with coverage
89+
if: ${{ matrix.wp_versions != '5.2' }}
90+
run: |
91+
sudo chown -R runner:runner plugin/tests node_modules # ensure coverage folder can be created
92+
npm run test:e2e:coverage
93+
94+
- name: Coveralls
95+
if: ${{ matrix.wp_versions != '5.2' }}
96+
uses: coverallsapp/github-action@master
97+
with:
98+
github-token: ${{ secrets.GITHUB_TOKEN }}
99+
path-to-lcov: ./plugin/tests/coverage/e2e/lcov.info
100+
flag-name: "E2E Tests"
101+
parallel: true
102+
103+
test-js:
104+
needs: [lint]
105+
name: "JS unit tests (with code coverage)"
106+
runs-on: ubuntu-latest
107+
108+
steps:
109+
- uses: actions/checkout@v2
110+
- uses: actions/setup-node@v1
111+
with:
112+
node-version: "14"
113+
114+
- name: Install dependencies
115+
run: npm ci
116+
117+
- name: Run JS tests
118+
run: npm run test:js:coverage
119+
120+
- name: Coveralls
121+
uses: coverallsapp/github-action@master
122+
with:
123+
github-token: ${{ secrets.GITHUB_TOKEN }}
124+
path-to-lcov: ./plugin/tests/coverage/js/lcov.info
125+
flag-name: "JS Unit Tests"
126+
parallel: true
127+
128+
test-php:
129+
needs: [lint]
130+
name: "PHP tests (PHP ${{ matrix.php_versions }}, WordPress ${{ matrix.wp_versions }})"
131+
runs-on: ${{ matrix.os }}
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
php_versions: [7.4, 7.3, 7.2, 7.1]
136+
wp_versions: ["latest"]
137+
os: [ubuntu-latest]
138+
include:
139+
- php_versions: 7.4
140+
wp_versions: "trunk"
141+
os: ubuntu-latest
142+
143+
- php_versions: "7.0"
144+
wp_versions: "latest"
145+
os: ubuntu-18.04 # Use ubuntu-18.4 which has MySQL 5.7 for back-compat < PHP7.0
146+
147+
- php_versions: 5.6.20
148+
wp_versions: "latest"
149+
os: ubuntu-18.04
150+
151+
- php_versions: 5.6.20
152+
wp_versions: "5.2"
153+
os: ubuntu-18.04
154+
155+
env:
156+
WP_VERSION: ${{ matrix.wp_versions }}
157+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158+
COVERALLS_PARALLEL: true
159+
COVERALLS: ${{ matrix.php_versions == 7.4 && matrix.wp_versions == 'latest' }}
160+
PROJECT_TYPE: plugin
161+
162+
steps:
163+
- uses: actions/checkout@v2
164+
- name: Setup PHP ${{ matrix.php_versions }}
165+
uses: shivammathur/setup-php@v2
166+
with:
167+
php-version: ${{ matrix.php_versions }}
168+
tools: phpunit
169+
170+
- name: Start MySQL
171+
run: |
172+
sudo systemctl enable mysql.service
173+
sudo systemctl start mysql.service
174+
175+
- name: Install dependencies
176+
run: composer install
177+
178+
- name: Copy block.json files
179+
run: for file in ./plugin/assets/src/block-editor/blocks/*/block.json; do dest="${file/.\/plugin\/assets\/src\/block-editor\//./plugin/assets/js/}"; mkdir -p `dirname $dest`; cp $file $dest; done
180+
181+
- name: Install and Run tests
182+
if: ${{ matrix.php_versions == '7.0' || matrix.php_versions == '5.6.20' }}
183+
run: |
184+
wget -O bin/phpunit https://phar.phpunit.de/phpunit-5.phar
185+
chmod +x bin/phpunit
186+
source bin/php-tests.sh wordpress_test root root localhost false bin/phpunit
187+
188+
- name: Install and Run tests
189+
if: ${{ matrix.php_versions != '7.0' && matrix.php_versions != '5.6.20' }}
190+
run: source bin/php-tests.sh wordpress_test root root localhost
191+
192+
finish:
193+
needs: [test-e2e, test-js, test-php]
194+
name: Finish
195+
runs-on: ubuntu-latest
196+
steps:
197+
- name: Coveralls Finished
198+
uses: coverallsapp/github-action@master
199+
with:
200+
github-token: ${{ secrets.github_token }}
201+
parallel-finished: true

.gitignore

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22
._.DS_Store
33
.env
44
.idea
5-
composer.lock
65
material-design.zip
6+
material-design-google.zip
77
yarn.lock
8-
assets/css/*
9-
!assets/css/src/
10-
assets/js/*
8+
plugin/assets/css/*
9+
!plugin/assets/css/src/
10+
plugin/assets/js/*
11+
theme/assets/css/*
12+
!theme/assets/css/src/
13+
theme/assets/js/*
1114
bin/local-dev/mysql/
1215
bin/local-dev/wordpress/html/
1316
build/
1417
node_modules/
15-
tests/coverage
1618
vendor/
19+
plugin/tests/coverage
20+
plugin/composer*
21+
theme/composer*

.stylelintignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/assets/css/*.css
1+
/theme/assets/css/*.css
2+
/plugin/assets/css/*.css
23
/bin
34
/build
45
/node_modules
56
/tests
67
/vendor
7-
/assets/css/src/mixins.css
8+
/plugin/assets/css/src/mixins.css

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ install:
5959
- npm run build:js
6060
- export DEV_LIB_PATH=vendor/xwp/wp-dev-lib/scripts
6161
- export DIFF_HEAD=HEAD
62+
- export DEFAULT_BASE_BRANCH=main
63+
- export PROJECT_TYPE=plugin
6264
- source "$DEV_LIB_PATH/travis.install.sh"
6365

6466
before_script:
@@ -99,7 +101,7 @@ jobs:
99101
- docker-compose exec mysql bash -c "chown -R mysql:mysql /var/lib/mysql"
100102
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password [email protected] --skip-email --url=http://localhost:8088
101103
- npm run wp -- wp plugin activate material-design
102-
- sudo chown -R travis:travis tests node_modules # ensure coverage folder can be created
104+
- sudo chown -R travis:travis plugin/tests node_modules # ensure coverage folder can be created
103105
- npm run test:e2e:coveralls
104106

105107
- name: E2E tests with Docker (7.3, WordPress 5.2)
@@ -119,7 +121,7 @@ jobs:
119121
- docker-compose exec mysql bash -c "chown -R mysql:mysql /var/lib/mysql"
120122
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password [email protected] --skip-email --url=http://localhost:8088
121123
- npm run wp -- wp plugin activate material-design
122-
- sudo chown -R travis:travis tests node_modules
124+
- sudo chown -R travis:travis plugin/tests node_modules
123125
- npm run test:e2e
124126

125127
- name: JS unit tests (7.4, WordPress latest, with code coverage)

0 commit comments

Comments
 (0)