version: 2

defaults: &defaults
    working_directory: ~/demoscene
    docker:
      - image: cahirwpz/demoscene:latest

jobs:
  check_style:
    <<: *defaults
    steps:
      - checkout
      - run: './style-python.sh'

  build:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: Git LFS (install Git Large File Storage)
          command: |
            apt-get -q update && apt-get upgrade -y
            apt-get install -y --no-install-recommends openssh-client
            mkdir -p ~/.ssh
            ssh-keyscan -H github.com >> ~/.ssh/known_hosts
            ssh git@github.com git-lfs-authenticate "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" download
            git lfs pull
      - run:
          name: Archive source tree
          command: 'cd ~ && tar cvzf /demoscene.tar.gz demoscene'
      - run:
          name: Amiga 500 (compile code base)
          command: 'cd a500 && make'
      - store_artifacts:
          path: /demoscene.tar.gz

workflows:
  version: 2
  build_and_test:
    jobs:
      - check_style
      - build

version: 2

defaults: &defaults
    working_directory: ~/demoscene
    docker:
      - image: cahirwpz/demoscene:latest

jobs:
  check_style:
    <<: *defaults
    steps:
      - checkout
      - run: './style-python.sh'

  build:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: Git LFS (install Git Large File Storage)
          command: |
            apt-get -q update && apt-get upgrade -y
            apt-get install -y --no-install-recommends openssh-client
            mkdir -p ~/.ssh
            ssh-keyscan -H github.com >> ~/.ssh/known_hosts
            ssh git@github.com git-lfs-authenticate "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" download
            git lfs pull
      - run:
          name: Archive source tree
          command: 'cd ~ && tar cvzf /demoscene.tar.gz demoscene'
      - run:
          name: Amiga 500 (compile code base)
          command: 'cd a500 && make'
      - store_artifacts:
          path: /demoscene.tar.gz

workflows:
  version: 2
  build_and_test:
    jobs:
      - check_style
      - build:
          requires:
            - check_style

Make sure job producing artifacts is run as last one.
Make sure job producing artifacts is run as last one.
