version: 2

aliases:
  - &defaults
      working_directory: ~/.swiftenv
      docker:
        - image: ubuntu:16.04

  - &install-dependencies
      run:
        name: Install Dependencies
        command: |
          apt-get -qq update
          apt-get -qq -y install make lsb-release curl git libicu55 libxml2 libcurl4-openssl-dev libc6-dev clang

jobs:
  test:
    <<: *defaults
    steps:
      - checkout
      - <<: *install-dependencies

      - run:
          name: Run Tests
          command: |
            make test

      - run:
          name: Run Integration Tests
          command: |
            make test-integration

workflows:
  version: 2
  test:
    jobs:
      - test

version: 2

aliases:
  - &defaults
      working_directory: ~/.swiftenv
      docker:
        - image: ubuntu:16.04

  - &install-dependencies
      run:
        name: Install Dependencies
        command: |
          apt-get -qq update
          apt-get -qq -y install make lsb-release curl git libicu55 libxml2 libcurl4-openssl-dev libc6-dev clang

jobs:
  test:
    <<: *defaults
    steps:
      - checkout
      - <<: *install-dependencies

      - run:
          name: Run Tests
          command: |
            make test

      - run:
          name: Run Integration Tests
          command: |
            make test-integration

  test-fish:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: Configure Fish for Swiftenv
          command: |
            mkdir -p ~/.config/fish
            echo 'set -gx SWIFTENV_ROOT "$HOME/.swiftenv"' > ~/.config/fish/config.fish
            echo 'set -gx PATH "$SWIFTENV_ROOT/bin" $PATH' >> ~/.config/fish/config.fish
            echo 'source (swiftenv init -|psub)' >> ~/.config/fish/config.fish
      - <<: *install-dependencies
      - run: apt-get -qq -y install fish
      - run: fish -c 'swiftenv install 4.1.2'
      - run: fish -c 'swift --version' | grep 4.1.2

workflows:
  version: 2
  test:
    jobs:
      - test
      - test-fish

Add primitive test for using swiftenv via fish
chore(ci): Add primitive test for using swiftenv via fish
