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

Set up GitHub workflows to run basic checks via Danger #6

Closed
wants to merge 11 commits into from

Conversation

mokagio
Copy link
Owner

@mokagio mokagio commented Feb 11, 2020

This is the first step to implement wordpress-mobile#13366.

This adds a GitHub workflows that run the shared Peril settings to:

screencapture-github-mokagio-WordPress-iOS-pull-6-2020-02-11-14_42_08

This setup uses the Danger GitHub Action. I like it because we don't have to add anything to our repo in order to run Danger, but it comes with a time overhead on CI because the action needs to be fetched and built.

Using the action is fine for now, I think, but we might want to do a performance comparison with a local Danger setup later on. It might be worth takin on the cost of maintaining a local setup if we can get a noticeably faster feedback loop for those opening the PR.

To test this, I'll be adding and removing labels to this PR as well as pushing (and then reverting) commits to trigger the sanity checks. If everything works, Danger will post warnings in those PRs via the GitHub Actions bot account. The bot account is what I got wrong in my previous PRs. I finally figured it thanks to the help of the Danger team.

@mokagio mokagio added enhancement New feature or request and removed enhancement New feature or request labels Feb 11, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 11, 2020

Here's a screenshot of Danger leaving a comment about the PR not having labels.

screencapture-github-mokagio-WordPress-iOS-pull-6-2020-02-11-14_27_48

@mokagio mokagio added the enhancement New feature or request label Feb 11, 2020
@mokagio
Copy link
Owner Author

mokagio commented Feb 11, 2020

Here's a screenshot showing a new workflow run after a label is added. Screen Shot 2020-02-11 at 14 31 21

(That's the labelled event.)

@mokagio
Copy link
Owner Author

mokagio commented Feb 11, 2020

Finally, here's a screenshot of the Danger comment being gone after the label has been added.

screencapture-github-mokagio-WordPress-iOS-pull-6-2020-02-11-14_34_43

If you try this label/unlabel process yourself, you might have to refresh the page after the GitHub Action build has finished to see comment gone. I guess GitHub updates the DOM when a new comment is posted or a check succeeds, but doesn't do it when a comment is removed.

@mokagio
Copy link
Owner Author

mokagio commented Feb 11, 2020

Here's a screenshot of Danger leaving a comment because I left a commit SHA in the `Podfile` and failing the build because of that.

screencapture-github-mokagio-WordPress-iOS-pull-6-2020-02-11-14_42_08

@mokagio
Copy link
Owner Author

mokagio commented Feb 11, 2020

Once the commit is rebased away, so is the failure comment.

screencapture-github-mokagio-WordPress-iOS-pull-6-2020-02-11-14_44_53

# The restrictions on the types of pull_request event that can trigger this
# workflow is intentional. We only want to run these sanity checks when the
# PR is opened or reopened, or its branch receives a push.
types: [opened, reopened, synchronize]
Copy link
Owner Author

Choose a reason for hiding this comment

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

For example, here you can see that after a push only the sanity checks run.

screencapture-github-mokagio-WordPress-iOS-pull-6-2020-02-11-14_40_12

@mokagio
Copy link
Owner Author

mokagio commented Feb 13, 2020

Closing, because wordpress-mobile#13423 has been merge upstream.

@mokagio mokagio closed this Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants