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

Generate GHA workflow files from originals #485

Merged
merged 22 commits into from
Jan 9, 2025

Conversation

ingydotnet
Copy link
Contributor

Moved original .github/workflows/*.yml files to a new dir called .github/workflows-ys/

Added a Makefile to the new directory. Running make build from there will generate the workflows/.yml files from workflows-src/.yml files using YAMLScript. Plain YAML files are valid YAMLScript, so these newly generated files should work the same.

The generated files have no comments and are formatted according to ys default rules.

From here forward, changes to the workflows-src files should not produce any changes to the workflow files.
This allows us to progressively refactor the workflow-src files and be sure no bad side effects have happened.

Moved original .github/workflows/*.yml files to a new dir called
.github/workflows-ys/

Added a Makefile to the new directory. Running `make build` from there
will generate the workflows/*.yml files from workflows-src/*.yml files
using YAMLScript. Plain YAML files are valid YAMLScript, so these newly
generated files should work the same.

The generated files have no comments and are formatted according to ys
default rules.

From here forward, changes to the workflows-src files should not produce
any changes to the workflow files.
This allows us to progressively refactor the workflow-src files and be
sure no bad side effects have happened.
@biojppm biojppm force-pushed the ys-workflows branch 2 times, most recently from 9408a6d to 89c896f Compare January 6, 2025 01:56
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.13%. Comparing base (c183e50) to head (f9583a9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #485      +/-   ##
==========================================
- Coverage   97.28%   97.13%   -0.15%     
==========================================
  Files          34       33       -1     
  Lines       11267    10473     -794     
==========================================
- Hits        10961    10173     -788     
+ Misses        306      300       -6     

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

@biojppm biojppm force-pushed the ys-workflows branch 5 times, most recently from 45a7834 to fb0b0b2 Compare January 7, 2025 17:59
@biojppm biojppm force-pushed the ys-workflows branch 2 times, most recently from 6fda518 to 9649f5c Compare January 8, 2025 12:51
@biojppm biojppm force-pushed the ys-workflows branch 4 times, most recently from 4a1d725 to 3d7fdb9 Compare January 9, 2025 10:47
@biojppm biojppm merged commit 70c4e36 into biojppm:master Jan 9, 2025
1 check passed
@biojppm
Copy link
Owner

biojppm commented Jan 9, 2025

Thanks @ingydotnet ! This enables an effective way of working around github's limited workflow syntax, and makes maintenance of the workflows a breeze.

For example,

wc -lm --total=never gcc.ys gcc.yml
  185  6866 gcc.ys
  957 33146 gcc.yml

that is, 185 -> 957 lines, and 7KB -> 33KB. That's a huge saving!

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