Config does not conform to schema error

Does anyone know why my script keeps getting this error when I run it. I looked at it with the yank parser and didn’t see any null values. Could someone take a look and tell me what they see?

Config does not conform to schema: {:workflows {:nightly-test-workflow {:jobs [{:nightly-android-test {:matrix disallowed-key, :name disallowed-key}}]}}}


version: 2

orbs:
  android: circleci/android@1.0.3
  gcp-cli: circleci/gcp-cli@2.2.0

jobs:
  build:
    working_directory: ~/code
    docker:
      - image: cimg/android:2022.04
        auth:
          username: mydockerhub-user
          password: $DOCKERHUB_PASSWORD  # context / project UI env-var reference
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      - run:
         name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
         command: sudo chmod +x ./gradlew
      - run:
          name: Download Dependencies
          command: ./gradlew androidDependencies
      - run:
          name: Run Tests
          command: ./gradlew lint test
      - store_artifacts:
          path: app/build/reports
          destination: reports
      - store_test_results:
          path: app/build/test-results

  nightly-android-test:
    parameters:
      system-image:
        type: string
        default: system-images;android-30;google_apis;x86
    executor:
      name: android/android-machine
      resource-class: xlarge
    steps:
      - checkout
      - android/start-emulator-and-run-tests:
          test-command: ./gradlew connectedDebugAndroidTest
          system-image: << parameters.system-image >>
      - run:
          name: Save test results
          command: |
            mkdir -p ~/test-results/junit/
            find . -type f -regex ".*/build/outputs/androidTest-results/.*xml" -exec cp {} ~/test-results/junit/ \;
          when: always
      - store_test_results:
          path: ~/test-results
      - store_artifacts:
          path: ~/test-results/junit

workflows:
  version: 2
  unit-test-workflow:
    jobs:
      - build
  nightly-test-workflow:
    jobs:
      - nightly-android-test:
          matrix:
            alias: android-test-all
            parameters:
              system-image:
                - system-images;android-30;google_apis;x86
                - system-images;android-29;google_apis;x86
                - system-images;android-28;google_apis;x86
                - system-images;android-27;google_apis;x86
          name: nightly-android-test-<<matrix.system-image>>
          filters:
            branches:
              only: main # Commits to main branch

YAML files are very white space dependent, but currently, you have posted in such a way as to lose all the white space. You should be able to retain the spacing if you use the </> option from the menu as this allows you to post pre-formated text.

Hey sorry. I fixed the formatting. Can you take a look now? Please let me know if I can clean the script up any further.

OK, my reply has to be limited as I’ve not used the matrix feature and so can not be sure that I am right in what I say next.

  • You are defining version as 2 at both the start of the script and within the workflow. The docs indicate that matrix is a 2.1 feature. Once you define 2.1 at the start of the script you should no longer need to also define it in the workflow section.

    Configuring CircleCI - CircleCI

Thank you! That fixed it!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.