version: 2

jobs:
  build:
    docker:
      - image: ubuntu:latest
    steps:
      - checkout
      - run:
          name: Install fish
          command: |
            apt-get --quiet update
            apt-get --quiet --yes install software-properties-common curl
            add-apt-repository --yes ppa:fish-shell/release-3
            apt-get --quiet --yes install fish
            fish --version
      - run:
          name: Install fisher
          shell: fish
          command: |
            curl -sLo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisher
            fisher version
          path: ~/fish-cd-git
      - run:
          name: Install gh
          shell: fish
          command: |
            fisher add < fishfile
            fisher add (pwd)
      - run: fish -c "fishtape test/*.fish"

version: 2

jobs:
  build:
    docker:
      - image: dideler/fish-shell:3.0.0
    shell: fish
    steps:
      - checkout
      - run:
          name: Install fisher
          command: |
            apt-get install --yes --quiet curl
            curl -sLo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisher
            fisher version
      - run:
          name: Install gh
          command: |
            fisher add < fishfile
            fisher add (pwd)
      - run:
          name: Run tests
          command: fishtape test/*.fish

Use fish-shell as docker image
Use fish-shell as docker image

The new image comes with a specific version of fish pre-installed.
See https://github.com/dideler/docker-fish-shell

Explicitly set shell to fish because CircleCI ignores what the default
shell in the container is, and will instead use its own default of
"/bin/bash -eo pipefail" to run commands in the container.
