runner icon indicating copy to clipboard operation
runner copied to clipboard

YAML Error: Did not expect 'map' when using Default group in runs-on

Open tyler-jewell opened this issue 2 years ago • 1 comments

Describe the bug When I try to use group: Default as the runs-on argument in the workflow yaml, an error appears saying 'Did not expect 'map''

To Reproduce Create a workflow yaml in .github/workflows:

name: Test and analyze app

on: [push]

jobs:
  test_and_analyze:
    runs-on:
      group: Default
    steps:
      - name: 📚 Git Checkout
        uses: actions/checkout@v3

      - name: Check Flutter
        run: flutter --version

      - name: ✨ Check Formatting
        run: flutter format --set-exit-if-changed lib test

      - name: 🕵️ Analyze
        run: flutter analyze lib test

      - name: 🧪 Run Tests
        run: flutter test --coverage --test-randomize-ordering-seed random -x e2e

Configure YAML to use https://json.schemastore.org/github-workflow.json as the formatter.

Expected behavior The YAML should have no errors since this is a valid argument per https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job

Runner Version and Platform

self-hosted macos

What's not working?

image

image

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

tyler-jewell avatar Jan 13 '23 18:01 tyler-jewell

I was able to fix this issue by using this yaml:

name: Test and analyze app

on: [push]

jobs:
  test_and_analyze:
    runs-on: self-hosted
    steps:
      - name: 📚 Git Checkout
        uses: actions/checkout@v3

      - name: Check Flutter
        run: flutter --version

      - name: ✨ Check Formatting
        run: flutter format --set-exit-if-changed lib test

      - name: 🕵️ Analyze
        run: flutter analyze lib test

      - name: 🧪 Run Tests
        run: flutter test --coverage --test-randomize-ordering-seed random -x e2e

It will then use my Default group by default and not error out.

Should we update to docs? This wasn't clear from reading them.

tyler-jewell avatar Jan 13 '23 19:01 tyler-jewell

Hi @tyler-jewell, this is not an issue related to the runner source code, but I've forwarded your feedback. It looks like the schema at https://json.schemastore.org/github-workflow.json is out of sync, you should be able to use runner groups like that regardless - or use the self-hosted label as you've discovered.

fhammerl avatar Feb 02 '23 13:02 fhammerl