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: Make runners configurable #840

Merged
merged 2 commits into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: '<%= @configs['pidfile_workaround'] %>'
<%- if @configs['unit_runs_on'] -%>
unit_runs_on: '<%= @configs['unit_runs_on'] %>'
<%- end -%>
<%- if @configs['acceptance_runs_on'] -%>
acceptance_runs_on: '<%= @configs['acceptance_runs_on'] %>'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been using larger runners in my control repo but I use a nested hash for the config. E.g.:

  rake_checks:
    runs-on:
      group: Default Larger Runners
      labels: ubuntu-latest-16-cores

I guess that could be done as a heredoc but the indenting would be fiddly.

<%- end -%>
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? -%>
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? || @configs.key?('unit_runs_on') -%>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder at which point we're just going to write it in Ruby and use to_yaml on it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah :(

Copy link
Member

@jhoblitt jhoblitt Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had the same thought. One of the issues with using psych to format is you can't control the indenting of lists and it always uses the non-indented form (which I find harder read). There's also no support for emitting comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better featured yaml parser/generator we could use?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, ruby/psych#594 is still unresolved :(

with:
<%- end -%>
<%- end -%>
Expand All @@ -29,3 +35,6 @@ jobs:
<%- if @configs.key?('rubocop') -%>
rubocop: <%= @configs['rubocop'] %>
<%- end -%>
<%- if Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].none? && @configs['unit_runs_on'] -%>
unit_runs_on: '<%= @configs['unit_runs_on'] %>'
<%- end -%>