# mainly this pipeline exists to test systemd integration
# otherwise there is no way to do it on github actions (e.g. Docker doesn't support it)
version: 2

jobs:
  install_and_run_test:
    machine:
      image: ubuntu-2004:202010-01
    steps:
      - checkout
      - run: python3 -m pip install --user --upgrade pip
      - run: python3 -m pip install --user .

      # ugh. Circle uses pyenv instead of default interpreter? and then systemd doesn't know of it :(
      - run: sudo ln -sf /opt/circleci/.pyenv/versions/3.*/bin/python3 /usr/bin/python3

      # FIXME ugh. systemd --user isn't working anymore for some reason, "can't connect to bus"???
      # couldn't manage to get it work with --system or sudo...
      #- run: tests/install_and_run


workflows:
  version: 2
  build_and_test:
    jobs:
      - install_and_run_test

# version: 2.1 # Use version 2.1 to enable Orb usage.

# orbs:
#   win: circleci/windows@2.4.0 # The Windows orb give you everything you need to start using the Windows executor.

# jobs:
#   build: # name of your job
#     executor: win/default # executor type

#     steps:
#       # Commands are run in a Windows virtual machine environment
#       - checkout
#       - run: Write-Host 'Hello, Windows'
#       - run: bash scripts/ci/run
