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: improve GitHub action workflow #23965

Merged
merged 3 commits into from Apr 30, 2024
Merged

Conversation

ceddy4395
Copy link
Contributor

Hey! 🙂
I want to contribute the following changes to your workflow:

  • Avoid uploading artifacts on forks
  • Use 'if' for upload-artifact action
  • Avoid uploading artifacts on forks
  • Run tests on multiple OS's

(These changes are part of a research Study at TU Delft looking at GitHub Action Smells. Find out more)

@ceddy4395 ceddy4395 requested a review from a team as a code owner April 25, 2024 11:14
@ceddy4395 ceddy4395 requested review from Jolg42 and removed request for a team April 25, 2024 11:14
@CLAassistant
Copy link

CLAassistant commented Apr 25, 2024

CLA assistant check
All committers have signed the CLA.

- Avoid uploading artifacts on forks
- Use 'if' for upload-artifact action
- Avoid uploading artifacts on forks
- Run tests on multiple OS's
@Jolg42
Copy link
Member

Jolg42 commented Apr 25, 2024

Hi @ceddy4395

Thanks for your PR 🙌🏼

I have one question: I'm not sure I understand the reason behind "Run tests on multiple OS's", could you explain why running on [ubuntu-latest, ubuntu-20.04] instead of only ubuntu-latest would be better?

@ceddy4395
Copy link
Contributor Author

Hi @Jolg42

The reasoning behind this smell is that during testing, differences in OS's in terms of default installed dependencies etc. should be taken into account.

I'm interested to hear your thoughts!

@Jolg42 Jolg42 self-assigned this Apr 30, 2024
@Jolg42
Copy link
Member

Jolg42 commented Apr 30, 2024

@ceddy4395 Got it.

Could you revert the runs-on: ${{matrix.os}} changes?

Why?

On main we have ~ 206 jobs
https://github.com/prisma/prisma/actions/runs/8891585684/usage

With your changes I see ~380 jobs
https://github.com/prisma/prisma/actions/runs/8831591209/usage?pr=23965

So this is a massive increase in the number of jobs, because of the matrix we use, and it looks like it did not catch any bug.
This means every new PR and merge to main will trigger all these additional jobs "for nothing", so I see this as a waste of time and resources. It also increases the number of things a developer needs to look after and probably more false positive as flaky tests might show up more often.
In the end, I don't see these as useful at the moment personally.

Note that we have some specific tests in https://github.com/prisma/ecosystem-tests/ for a lot of things.
Example: the docker tests on different OSes https://github.com/prisma/ecosystem-tests/tree/dev/docker

@ceddy4395
Copy link
Contributor Author

@Jolg42 I've removed the ${{matrix.os}} I had introduced recently.

I see your concerns, thank you for providing the feedback!

With adding more matrix.os's the number of jobs drastically increased.

Signed-off-by: Cedric Willekens <cedric@willekens.dev>
Copy link

codspeed-hq bot commented Apr 30, 2024

CodSpeed Performance Report

Merging #23965 will improve performances by 22.94%

Comparing ceddy4395:fix-gha-smells (24a16ec) with main (ccebff2)

Summary

⚡ 1 improvements
✅ 2 untouched benchmarks

Benchmarks breakdown

Benchmark main ceddy4395:fix-gha-smells Change
client generation 100 models with relations 39.5 s 32.1 s +22.94%

@Jolg42 Jolg42 changed the title Fix potential github action smells ci: improve GitHub action workflow Apr 30, 2024
@Jolg42 Jolg42 added this to the 5.14.0 milestone Apr 30, 2024
@Jolg42 Jolg42 merged commit 6b3a4d1 into prisma:main Apr 30, 2024
212 of 215 checks passed
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.

None yet

3 participants