version: 2.1
jobs:
  xcode_codecov:
    macos:
      xcode: "10.0.0"
    shell: /bin/bash --login -eo pipefail
    environment:
      XCODE_FLAGS: -scheme Base32
      XCODE_FLAGS_FOR_TEST: -enableCodeCoverage YES -parallel-testing-enabled NO
    steps:
      - checkout
      - run: mkdir -p build/reports
      - run: >
          xcodebuild $XCODE_FLAGS $XCODE_FLAGS_FOR_TEST test |
          xcpretty -r junit -o build/reports/xcodebuild-macOS.xml
      - store_test_results:
          path: build/reports/
      - run: bash <(curl -s https://codecov.io/bash)

  test_with_image:
    parameters:
      image:
        type: string
    docker:
      - image: << parameters.image >>
    steps:
      - checkout
      - run: swift test

workflows:
  workflow:
    jobs:
      - xcode_codecov
      - test_with_image:
          name: linux_swift_4.2
          image: norionomura/swift:4.2.0

version: 2.1
jobs:
  xcode_codecov:
    macos:
      xcode: "10.0.0"
    shell: /bin/bash --login -eo pipefail
    environment:
      XCODE_FLAGS: -scheme Base32
      XCODE_FLAGS_FOR_TEST: -enableCodeCoverage YES -parallel-testing-enabled NO
    steps:
      - checkout
      - run: mkdir -p build/reports
      - run: >
          xcodebuild $XCODE_FLAGS $XCODE_FLAGS_FOR_TEST test |
          xcpretty -r junit -o build/reports/xcodebuild-macOS.xml
      - store_test_results:
          path: build/reports/
      - run: bash <(curl -s https://codecov.io/bash)

  test_with_image:
    parameters:
      image:
        type: string
    docker:
      - image: << parameters.image >>
    steps:
      - checkout
      - run: swift test

workflows:
  workflow:
    jobs:
      - xcode_codecov
      - test_with_image:
          name: linux_swift_4.2
          image: norionomura/swift:4.2
      - test_with_image:
          name: linux_swift_5.0
          image: norionomura/swift:5.0

Use latest minor versions of Swift 4.2 and 5.0
[CircleCI] Use latest minor versions of Swift 4.2 and 5.0
