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

Optimize CI/CD runs #20

Open
2 tasks
Doreapp opened this issue Nov 26, 2022 · 0 comments
Open
2 tasks

Optimize CI/CD runs #20

Doreapp opened this issue Nov 26, 2022 · 0 comments

Comments

@Doreapp
Copy link
Owner

Doreapp commented Nov 26, 2022

What ?

Limit the duration of CI/CD execution and there occurrences. It means running a CI/CD job only when it is necessary. For example check the linting of the python scripts only when a python script was updated.

Why ?

In order to fasten CI/CD executions and reduce the overall computing time. Indeed, even it the CI/CD runs are done in github magic cloud, it still is physically executed on computers. Thus, doing less CI/CD runs will reduce the power consumption of these devices, and so the CO2 emissions (even if most likely negligible regarding other emissions).

How ?

  • Separate the jobs in several workflows, such as one dedicated to the frontend (with Typescript linter) and one for the backend (with Python linter, unit and integration tests)
  • Add triggers to run the job only on some files push (see below)

💡 Run workflow only on files push

# .github/workflow-for-python.yml
on:
  push:
    paths:
      - "backend/app/**"
      - "backend/requirements*"
      - "**.py"
# ...
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

No branches or pull requests

1 participant