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

Only test/deploy website if relevant files are changed #6626

Merged
merged 11 commits into from
Jul 5, 2018
Merged

Only test/deploy website if relevant files are changed #6626

merged 11 commits into from
Jul 5, 2018

Conversation

endiliey
Copy link
Contributor

@endiliey endiliey commented Jul 5, 2018

Summary

Based on @thymikee
#6567 (comment)

Even better if it could be scoped to detected changes in docs/ dir <3

Test plan

  1. Test logic.
    Consider this script
WEBSITE_CHANGED=$(git diff-tree --no-commit-id --name-only -r HEAD | grep -E -c "(^docs\/.*)|(^website\/.*)")
if [[ $WEBSITE_CHANGED == 0 ]]; then
    echo "No relevant website files has changed"
    exit 0;
else
    echo "Relevant website files has changed"
fi

Change in docs/website folder commit
change in docs-or-website-folder

No change in docs/website folder commit
no change in docs-or-website folder

  1. Look at circleci

no-test

thymikee
thymikee previously approved these changes Jul 5, 2018
Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough to me!

@endiliey
Copy link
Contributor Author

endiliey commented Jul 5, 2018

@thymikee still need refactor & work in progress (Still failing as well).
I think I'll create a website.sh.

@thymikee thymikee dismissed their stale review July 5, 2018 06:43

review later

@endiliey endiliey changed the title [WIP] Only test/deploy website if relevant files are changed Only test/deploy website if relevant files are changed Jul 5, 2018
@endiliey
Copy link
Contributor Author

endiliey commented Jul 5, 2018

This is ready for review.

echo "Skipping deploy. Test website build"
cd website && yarn && yarn build
fi
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing newline?

@@ -0,0 +1,30 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have set -e or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true. I forget 😢


FILES_CHANGED=$(git diff-tree --no-commit-id --name-only -r HEAD)
if grep -E "(^docs\/.*)|(^website\/.*)" $FILES_CHANGED; then
echo "Skipping deploy & test. No relevant website files has changed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the nit but this should be:

No relevant website files have changed

@endiliey
Copy link
Contributor Author

endiliey commented Jul 5, 2018

Alright this should be ok now. Had a small bug due to set -e causing auto exit on grep before

1

2

3

sudo apt-get install default-jre rsync
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
sleep 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this sleep still needed?

Copy link
Contributor Author

@endiliey endiliey Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh i don't think it is needed but I'm just following the previous script. Want to remove ?

Docusaurus use it though
https://github.com/facebook/Docusaurus/blob/3566483aa5fbe0b9cd6988aa14b255f4092ca4c7/.circleci/config.yml#L83

i didn't use it on my test site. Still works flawlessly 😂
https://github.com/endiliey/endiliey.github.io/blob/4c6abe0786e2be11cda2ae7c8d847e957d6ba89d/.travis.yml#L37-L41

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kill it

@codecov-io
Copy link

codecov-io commented Jul 5, 2018

Codecov Report

Merging #6626 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6626   +/-   ##
=======================================
  Coverage   63.73%   63.73%           
=======================================
  Files         235      235           
  Lines        8935     8935           
  Branches        4        3    -1     
=======================================
  Hits         5695     5695           
  Misses       3239     3239           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6512ad...031b646. Read the comment docs.

@thymikee thymikee merged commit 14e8bbf into jestjs:master Jul 5, 2018
@endiliey endiliey deleted the web branch July 6, 2018 03:55
schalkneethling pushed a commit to mdn/interactive-examples that referenced this pull request Jul 6, 2018
This Pull Request renovates the package group "jest monorepo".


-   [jest-environment-node](https://github.com/facebook/jest) (`devDependencies`): from `23.2.0` to `23.3.0`
-   [jest](https://github.com/facebook/jest) (`devDependencies`): from `23.2.0` to `23.3.0`

# Release Notes
<details>
<summary>facebook/jest</summary>

### [`v23.3.0`](https://github.com/facebook/jest/blob/master/CHANGELOG.md#&#8203;2330)
[Compare Source](jestjs/jest@v23.2.0...v23.3.0)
##### Features

- `[jest-cli]` Allow watch plugin to be configured ([#&#8203;6603](`jestjs/jest#6603))
- `[jest-snapshot]` Introduce `toMatchInlineSnapshot` and `toThrowErrorMatchingInlineSnapshot` matchers ([#&#8203;6380](`jestjs/jest#6380))
##### Fixes

- `[jest-regex-util]` Improve handling already escaped path separators on Windows ([#&#8203;6523](`jestjs/jest#6523))
- `[jest-cli]` Fix `testNamePattern` value with interactive snapshots ([#&#8203;6579](`jestjs/jest#6579))
- `[jest-cli]` Fix enter to interrupt watch mode ([#&#8203;6601](`jestjs/jest#6601))
##### Chore & Maintenance

- `[website]` Switch domain to https://jestjs.io ([#&#8203;6549](`jestjs/jest#6549))
- `[tests]` Improve stability of `yarn test` on Windows ([#&#8203;6534](`jestjs/jest#6534))
- `[*]` Transpile object shorthand into Node 4 compatible syntax ([#&#8203;6582](`jestjs/jest#6582))
- `[*]` Update all legacy links to jestjs.io ([#&#8203;6622](`jestjs/jest#6622))
- `[docs]` Add docs for 23.1, 23.2, and 23.3 ([#&#8203;6623](`jestjs/jest#6623))
- `[website]` Only test/deploy website if relevant files are changed ([#&#8203;6626](`jestjs/jest#6626))
- `[docs]` Describe behavior of `resetModules` option when set to `false` ([#&#8203;6641](`jestjs/jest#6641))

---


</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants