Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automatically triggers test action and waits for test results before merged #71

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

Merged
shenxianpeng merged 6 commits into master from trigger-test-action
Jun 24, 2022

Conversation

@shenxianpeng
Copy link
Collaborator

@shenxianpeng shenxianpeng commented Jun 23, 2022
edited
Loading

Since we can not pass branch variables like cpp-linter/cpp-linter-action@${{ branch_name }} in the test action YAML file, the laziest way is to wait for the PR to be merged into the master branch and test it. (hope we could have another better way for testing before merging in the future)

Instead of manully running the test actions, I'm creating this action to automatically trigger test repo actions and wait for the result when PR is merged.

Instead of finding a more official way to do this, I found this action called convictional/trigger-workflow-and-wait

@shenxianpeng shenxianpeng added the enhancement New feature or request label Jun 23, 2022
@shenxianpeng shenxianpeng changed the title (削除) Automaticlly trigger test action and wait for test result when PR merged (削除ここまで) (追記) Automatically triggers test action and waits for test results after PR merged (追記ここまで) Jun 23, 2022
Copy link
Collaborator

2bndy5 commented Jun 23, 2022

Seems like a complex solution. Typically, I would

  1. create a test branch
  2. modify the either/both workflow(s) to use the specific branch of cpp-linter-action repo
  3. trigger the workflow. Lately, I've had to do this manually because the push triggers were removed at some point (which just adds more work).

My only objection to this is when we need to test a PR event. I think using this approach would entail

  1. merging a test branch to master
  2. opening another branch to PR master into the new branch
  3. when done testing, reset master to previous commit (prior to merging test branch into master)

Am I understanding this correctly?

Copy link
Collaborator

2bndy5 commented Jun 23, 2022

I wish we could use reusable workflows, but we still have the non-dynamic uses problem, and we can't call a reusable workflow from a workflow that uses a matrix.

shenxianpeng reacted with thumbs up emoji

Copy link
Collaborator Author

I totally agree with your workflow, that's the right one, the only problem is it involves manual work.

This PR is not good, its approach is to check merged code and revert if any test failed 😢

Copy link
Collaborator

@2bndy5 2bndy5 left a comment

Choose a reason for hiding this comment

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

I personally won't use it, but I don't think it would hurt to have it (even if only to try it out). You made me curious... 🤓

@shenxianpeng shenxianpeng marked this pull request as draft June 23, 2022 10:28
Copy link
Collaborator Author

Convert to draft in case there is other good options.

2bndy5 reacted with thumbs up emoji

Copy link
Collaborator Author

I have an idea that I can add a tag for each latest commit, for example, tag lastest.

Then change the uses from cpp-linter/cpp-linter-action@master to cpp-linter/cpp-linter-action@latest

2bndy5 reacted with rocket emoji

@shenxianpeng shenxianpeng marked this pull request as ready for review June 24, 2022 06:31
@shenxianpeng shenxianpeng changed the title (削除) Automatically triggers test action and waits for test results after PR merged (削除ここまで) (追記) Automatically triggers test action and waits for test results before merged (追記ここまで) Jun 24, 2022
@shenxianpeng shenxianpeng merged commit e4cf6e4 into master Jun 24, 2022
@shenxianpeng shenxianpeng deleted the trigger-test-action branch June 24, 2022 06:34
Copy link
Collaborator

2bndy5 commented Jun 24, 2022

I didn't realize this was the action repo. I thought this was the test repo.

2bndy5 reacted with laugh emoji

Copy link
Collaborator Author

shenxianpeng commented Jun 24, 2022
edited
Loading

Oh, so you felt curious yesterday

Copy link
Collaborator

2bndy5 commented Jun 24, 2022

I'm still curious.

Sorry, I'm rather distracted. I'm writing a C/C++ source code parser using clang to automate beautiful documentation in Sphinx. Doxygen SUCKS, and breathe (extension for Sphinx) is limited to Doxygen's XML output (which is worse than Doxyen's HTML output).

Copy link
Collaborator Author

For this PR, I just want to test any PRs using the test actions in the test repo without any manual work. Bypass passing variables to uses, I used a fixed tag latest to achive, a little complex solution.

I'm not familly with Sphinx, it looks like a beautiful document tool and polular. plooking forward to use it :)

2bndy5 reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@2bndy5 2bndy5 2bndy5 approved these changes

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /