circle.yml 4.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:

libinput_jobs:
  default_settings: &default_settings
    working_directory: ~/libinput
  # Define a couple of standardized build targets
  # that we call from every build container
  build_and_test_default: &build_and_test_default
    name: Build
    command: |
      rm -rf build
      meson build ${MESON_PARAMS}
      mesonconf build
      ninja -v -C build ${NINJA_ARGS}
    environment:
      MESON_PARAMS: --prefix=/opt/libinput
  build_and_test: &build_and_test
    run:
      <<: *build_and_test_default
  build_no_libwacom: &build_no_libwacom
    run:
      <<: *build_and_test_default
      name: Build - No libwacom
      environment:
        MESON_PARAMS: -Dlibwacom=false
  build_no_debug_gui: &build_no_debug_gui
    run:
      <<: *build_and_test_default
      name: Build - No debug-gui
      environment:
        MESON_PARAMS: -Ddebug-gui=false
  build_no_tests: &build_no_tests
    run:
      <<: *build_and_test_default
      name: Build - No tests
      environment:
        MESON_PARAMS: -Dtests=false
  build_no_docs: &build_no_docs
    run:
      <<: *build_and_test_default
      name: Build - No docs
      environment:
        MESON_PARAMS: -Ddocumentation=false
44 45 46 47 48 49
  build_dist: &build_dist
    run:
      <<: *build_and_test_default
      name: Build - ninja dist
      environment:
        NINJA_ARGS: dist
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
  ninja_scan_build: &ninja_scan_build
    run:
      <<: *build_and_test_default
      name: Ninja scan-build
      environment:
        NINJA_ARGS: scan-build
  install: &install
    run:
      name: Installing
      command: ninja -v -C build install
  export_logs: &export_logs
    store_artifacts:
      path: ~/libinput/build/meson-logs

# Ubuntu's meson is too old, these instructions are
# meson-specific
meson_from_git: &meson_from_git
  run:
    name: Install meson from git
    environment:
      MESON_VERSION: 0.41.0
    command: |
      git clone https://github.com/mesonbuild/meson
      pushd meson
      git checkout -f ${MESON_VERSION}
      python3 ./setup.py install --prefix=/usr --install-layout=deb --install-lib=/usr/share/meson --install-scripts=/usr/share/meson
      popd
      rm -rf meson

fedora_install: &fedora_install
  run:
    name: Install prerequisites
    command: |
      dnf install -y git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel doxygen graphviz valgrind binutils libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel

fedora_build_all: &fedora_build_all
  <<: *default_settings
  steps:
    - *fedora_install
    - checkout
    - *build_and_test
    - *install
    - *export_logs
    - *build_no_libwacom
    - *build_no_debug_gui
    - *build_no_tests
    - *build_no_docs
97
    - *build_dist
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

ubuntu_install: &ubuntu_install
  run:
    name: Install prerequisites
    command: |
      apt-get update
      apt-get install -y software-properties-common
      add-apt-repository universe
      apt-get update
      apt-get install -y git gcc g++ meson check libudev-dev libevdev-dev doxygen graphviz valgrind binutils libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev

ubuntu_build_all: &ubuntu_build_all
  <<: *default_settings
  steps:
    - *ubuntu_install
    - *meson_from_git # meson version not recent enough
    - checkout
    - *build_and_test
    - *install
    - *export_logs
    - *build_no_libwacom
    - *build_no_debug_gui
    - *build_no_tests
    - *build_no_docs
122
    - *build_dist
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

scan_build_run: &scan_build_run
  <<: *default_settings
  steps:
    - *fedora_install
    - run:
        name: Install clang and find
        command: dnf install -y clang-analyzer findutils
    - checkout
    - *ninja_scan_build
    - *export_logs
    - run:
        name: Check scan-build results
        command: test ! -d ~/libinput/build/meson-logs/scanbuild || test $(find ~/libinput/build/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 || (echo "Check scan-build results" && false)

version: 2
jobs:
  fedora_latest:
    <<: *fedora_build_all
    docker:
      - image: fedora:latest
  ubuntu_17_04:
    <<: *ubuntu_build_all
    docker:
      - image: ubuntu:zesty
  scan_build:
    <<: *scan_build_run
    docker:
      - image: fedora:latest

workflows:
  version: 2
  compile:
    jobs:
      - fedora_latest
      - scan_build
      - ubuntu_17_04