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

runs-on is too strict in workflow files #2579

Closed
RJWadley opened this issue Nov 3, 2022 · 3 comments · Fixed by #2711
Closed

runs-on is too strict in workflow files #2579

RJWadley opened this issue Nov 3, 2022 · 3 comments · Fixed by #2711
Labels
issue:bug Report errors or unexpected behavior (auto-generated by issue forms)

Comments

@RJWadley
Copy link

RJWadley commented Nov 3, 2022

Area with issue?

JSON Schema

✔️ Expected Behavior

runs-on should accept any valid label, or any valid list of labels without requiring the 'self-hosted' label

❌ Actual Behavior

Thanks to GitHubs new larger runners feature, github-hosted runners can now be given any custom label.

When using this custom label to refer in runs-on in a workflow syntax the schema insists I add "self-hosted" to the list of labels. This, while correct in the past, would no longer address the correct runner. As far as I can tell, there currently is no way to address a specific larger runner within the bounds of the schema.

Documentation for this is available here: https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners#using-labels-to-control-where-jobs-are-run

YAML or JSON file that does not work.

# in this example, a github-hosted runner has been created with the label 'example-runner-label' 

name: Hello World
on: [push]
jobs: 
  hello_world_job:
    runs-on: example-runner-label
    steps:
      - name: Hello world action step
        run: echo "Hello World"

IDE or code editor.

No response

Are you making a PR for this?

No, someone else must create the PR.

@RJWadley RJWadley added the issue:bug Report errors or unexpected behavior (auto-generated by issue forms) label Nov 3, 2022
@GerryFerdinandus
Copy link
Contributor

The schema enforce the recommendation self-hosted label as described in the documentation.
Nothing wrong with enforcing the recommendation/best practice

What's wrong here is that the present schema lacks support for group: and labels:

name: learn-github-actions
on: [push]
jobs:
  check-bats-version:
    runs-on:
      group: ubuntu-runners
      labels: ubuntu-20.04-16core
    steps:
      - uses: actions/checkout@v3

Or list of labels

runs-on:
  group: my-group
  labels: [ self-hosted, label-1 ]

@AndrewGable
Copy link

Echoing @RJWadley - It seems like this should be valid:

jobs:
  e2e-tests:
    name: "Run e2e performance regression tests"
    runs-on: ubuntu-20.04-64core

ubuntu-20.04-64core is a custom name for a large runner.

@aktech
Copy link

aktech commented Nov 17, 2022

By the way, if you want a no-maintenance method to achieve that, you can use cirun.io for the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue:bug Report errors or unexpected behavior (auto-generated by issue forms)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants