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

Introduce Code Documentation Workflow Dependent on CMake Workflow #68

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

franziska-wegner
Copy link
Owner

@franziska-wegner franziska-wegner commented Jan 2, 2024

This PR separates workflows by task such that they become reusable [7], e.g., the cmake workflow which content is required and duplicated in the other workflows will run in the end only once. This will save computational power and time in the end. There are different events that may trigger workflows given in [6]. Another option is to call the workflows in the main workflow directly [8]. For the two former options there is a big difference in reusability of the dependent workflows. It is worth testing the context reusability of both versions (see below).

Advantage:

  1. Reuse results and workflows [7],
  2. Consume less computational resources,
  3. Build does not fail multiple times,
  4. Gives the workflow structure and gives them a better granularity,
  5. Reduces the workflow size,
  6. Simplifies adding new workflows.

Unfortunately the dependent workflows do not inherent the whole environment. As such we need to make sure to maintain the build directory and the installations for the upcoming workflows. There are two approaches given by GitHub, (1) Caching, and (2) Artifacts. A docker solution is also given in [8].

Caching makes more sense in our case as we need the result directly and only for the workflows that depend on a particular workflow, i.e., the build directory is not a long living artifact, but a short term object only required for the dependent workflows [4]. The caching approach is also less time consuming and thus, preferable.

In total, we add and modify the following files to have the resulting dependency graph:
modified: .github/workflows/cmake-multi-platform.yml
new file: .github/workflows/code-documentation.yml

[1] https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
[2] https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
[3] https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization
[4] https://levelup.gitconnected.com/github-actions-how-to-share-data-between-jobs-fc1547defc3e
[5] https://stackoverflow.com/questions/58457140/dependencies-between-workflows-on-github-actions
[6] https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
[7] https://docs.github.com/en/actions/using-workflows/reusing-workflows
[8] https://stackoverflow.com/questions/57498605/github-actions-share-workspace-artifacts-between-jobs

Screenshot 2024-01-02 at 8 48 23 AM

…rm workflow

Why:
* Make workflow run less resource consuming by reusing results,
* The build fails not multiple times for different workflows, but once,
* Gives the workflow structure,
* Reduces the workflow size and simplifies adding new workflows easily.

On branch franziska-wegner/2024/january/CI/make-workflow-compact
Changes to be committed:
	modified:   .github/workflows/cmake-multi-platform.yml
	new file:   .github/workflows/code-documentation.yml
@franziska-wegner franziska-wegner added documentation Improvements or additions to documentation enhancement New feature or request CI/CD Changes in the CI process labels Jan 2, 2024
@franziska-wegner franziska-wegner self-assigned this Jan 2, 2024
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cb587f8) 94.37% compared to head (dc79edb) 94.37%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #68   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files          49       49           
  Lines        4921     4921           
=======================================
  Hits         4644     4644           
  Misses        277      277           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Changes in the CI process documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

1 participant