on: push

jobs:
  ok-container:
    runs-on: ubuntu-latest
    container:
      image: ubuntu:latest
      credentials: ${{ fromJSON('{}') }}
    steps:
      - run: echo ok
  err-container-1:
    runs-on: ubuntu-latest
    container:
      image: ubuntu:latest
      credentials: 'username:password'
    steps:
      - run: echo credentials must be a mapping
  err-container-2:
    runs-on: ubuntu-latest
    container:
      image: ubuntu:latest
      credentials: ${{ 'username:password' }}
    steps:
      - run: echo credentials value must be an object
  ok-services:
    runs-on: ubuntu-latest
    services:
      redis:
        image: redis:latest
        credentials: ${{ fromJSON('{}') }}
    steps:
      - run: echo ok
  err-services-1:
    runs-on: ubuntu-latest
    services:
      foo:
        image: ubuntu:latest
        credentials: 'username:password'
    steps:
      - run: echo credentials must be a mapping
  err-services-2:
    runs-on: ubuntu-latest
    services:
      foo:
        image: ubuntu:latest
        credentials: ${{ 'username:password' }}
    steps:
      - run: echo credentials value must be an object
