Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Should run the tests when needed #12510

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,62 @@ jobs:
- run:
name: material-ui-icons
command: |
if [[ ((`git diff --raw master | grep packages/material-ui-icons` > 0))]]; then
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)

# latest commit where packages/material-ui-icons was changed
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff packages/material-ui-icons)

if [ $FOLDER_COMMIT = $LATEST_COMMIT ]; then
echo "changes, let's run the tests"
cd packages/material-ui-icons && yarn test
else
echo "no changes "
echo "no changes"
fi
- run:
name: material-ui-codemod
command: |
if [[ ((`git diff --raw master | grep packages/material-ui-codemod` > 0))]]; then
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)

# latest commit where packages/material-ui-codemod was changed
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff packages/material-ui-codemod)

if [ $FOLDER_COMMIT = $LATEST_COMMIT ]; then
echo "changes, let's run the tests"
cd packages/material-ui-codemod && yarn test
else
echo "no changes "
echo "no changes"
fi
- run:
name: material-ui-lab
command: |
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)

# latest commit where packages/material-ui-lab was changed
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff packages/material-ui-lab)

if [ $FOLDER_COMMIT = $LATEST_COMMIT ]; then
echo "changes, let's run the tests"
cd packages/material-ui-lab && yarn test
else
echo "no changes"
fi
- run:
name: eslint-plugin-material-ui
command: |
if [[ ((`git diff --raw master | grep packages/eslint-plugin-material-ui` > 0))]]; then
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)

# latest commit where packages/eslint-plugin-material-ui was changed
FOLDER_COMMIT=$(git log -1 --format=format:%H --full-diff packages/eslint-plugin-material-ui)

if [ $FOLDER_COMMIT = $LATEST_COMMIT ]; then
echo "changes, let's run the tests"
cd packages/eslint-plugin-material-ui && yarn test
else
echo "no changes "
echo "no changes"
fi
test_build:
<<: *defaults
Expand Down
3 changes: 2 additions & 1 deletion packages/material-ui-icons/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ async function worker({ svgPath, options, renameFilter, template }) {
.replace(/ clip-path=".+?"/g, '') // Fix visibility issue and save some bytes.
.replace(/<clipPath.+?<\/clipPath>/g, ''); // Remove unused definitions

const size = Number(svgPath.match(/^.*_([0-9]+)px.svg$/)[1]);
const sizeMatch = svgPath.match(/^.*_([0-9]+)px.svg$/);
const size = sizeMatch ? Number(sizeMatch[1]) : null;

if (size !== 24) {
const scale = Math.round((24 / size) * 100) / 100; // Keep a maximum of 2 decimals
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-icons/builder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('builder', () => {
'svg',
'000000',
'transparent',
'dice-six-faces-four.js',
'Dice-six-faces-four.js',
);
assert.strictEqual(fs.existsSync(actualFilePath), true);

Expand Down