lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

Duplicate actions in the CI pipeline

Open nazarhussain opened this issue 2 years ago • 5 comments

Describe the bug

There are few actions in the CI pipeline, which duplicates with others. e.g. The tests runs twice on a PR when you push new commit.

Expected behavior

The CI tasks should not be duplicate on any case

Steps to Reproduce

  • Create a PR
  • Push some commit to it

Additional Information

There are certain tasks in the PR which can be run in parallel to speed up the CI. e.g. Linting and Unit tests don't need to be run in the sequence.

Some reference:

https://github.com/marketplace/actions/skip-duplicate-actions

nazarhussain avatar Aug 01 '22 08:08 nazarhussain

I think the tests run once on the feature branch ("push') and once on the feature branch merged into the base branch ('pull_request'). Maybe there are some other duplicate actions though.

The reason we run lint and unit tests sequentially is bc it takes longer to run them in parallel since the setup takes longer than linting. Not sure if thats still the case, but thats the original reason.

wemeetagain avatar Aug 01 '22 15:08 wemeetagain

The pull request trigger works on the push as well. So why for each push these CI tasks run twice.

For the other tasks, not everything can run parallel, but there are few tasks e.g. browser tests and unit test that we can run in parallel to speed up the CI.

nazarhussain avatar Aug 02 '22 14:08 nazarhussain

There still seems to be redundant pipelines executing on PRs. Which is taking unnecessary time in CI cycle.

image

nazarhussain avatar Sep 12 '22 12:09 nazarhussain

I think we still want both. They are not redundant. My understanding is that push and pull_request run the tests from two different commits. push runs the tests from the branch, pull_request runs the tests from the base branch with the feature branch merged.

wemeetagain avatar Sep 12 '22 14:09 wemeetagain

Yes that's because of the checkout actions. actions/checkout@v2 and particular behavior of GITHUB_SHA for each event. Don't you think it's important to checkout only the merge reference on the PRs to save time on CI?

nazarhussain avatar Sep 12 '22 14:09 nazarhussain

Closed with https://github.com/ChainSafe/lodestar/pull/4552

nazarhussain avatar Sep 23 '22 09:09 nazarhussain