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

CI: Allow running github actions on all branches #365

Closed
wants to merge 1 commit into from

Conversation

cmd-ntrf
Copy link
Contributor

@cmd-ntrf cmd-ntrf commented May 1, 2024

  1. All running tests on feature branches
  2. Remove Ruby 2.6 from matrix as it was now excluded from all tests Fixed by PR Drop Ruby 2.6 leftovers in CI config #369
  3. Remove "spec tests" as it is the exact same as "Run tests" Fixed by PR CI: Dont run tests twice #375

@cmd-ntrf cmd-ntrf changed the title Maintenance of test github workflow Housekeeping of test github workflow May 1, 2024
@cmd-ntrf cmd-ntrf changed the title Housekeeping of test github workflow Allow running github actions on all branches May 3, 2024
Comment on lines 4 to +7
pull_request: {}
push:
branches:
- master
- '*'
Copy link
Member

Choose a reason for hiding this comment

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

the idea of this section is that tests run on each pull request and again after a merge. This can catch errors when the PR feature branch wasn't up2date. Now if someone creates a PR based on a feature branch in this repo, not in a fork, will the tests run twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With branches : ['master'], if someone creates a feature branch in this repo, no tests are running until merged in master where tests will run once.

If the feature branch is merged in master, tests will run while developing the feature branch then again when merged in master.

Copy link
Member

Choose a reason for hiding this comment

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

With branches : ['master'], if someone creates a feature branch in this repo, no tests are running until merged in master where tests will run once.

That's not correct. We've the pull_request: {} setting to ensure tests run every PR, no matter in which repo the branch lives.

Copy link
Contributor Author

@cmd-ntrf cmd-ntrf May 3, 2024

Choose a reason for hiding this comment

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

I said feature branch "in this repo", not a PR. Try forking the repo, create a feature branch, you will see the tests are not running.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now if someone creates a PR based on a feature branch in this repo, not in a fork, will the tests run twice?
Sorry, it took me sometime to figure out what you meant here and I had to experiment this myself in another unrelated repo. Yes, if the feature branch is made into a PR, the tests will run twice, once for the branch, once for the PR, which is not ideal although I am not sure how to prevent this.

My objective here was to have the tests running when someone forks and develops something in feature branch without having to make PR.

@cmd-ntrf cmd-ntrf changed the title Allow running github actions on all branches CI: Allow running github actions on all branches May 3, 2024
@cmd-ntrf cmd-ntrf closed this May 6, 2024
@cmd-ntrf cmd-ntrf deleted the workflow branch May 7, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants