.gitlab-ci.yml 1.68 KB
Newer Older
1 2
stages:
  - build
Duncan Macleod's avatar
Duncan Macleod committed
3
  - test
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

# -- build ------------------

.build: &build
  stage: build
  after_script:
    - ls -l dist/
  artifacts:
    expire_in: 3h
    paths:
      - dist

build:tarball:
  <<: *build
  image: python:3.6
  script:
    - python setup.py sdist bdist_wheel

build:el7:
  <<: *build
  image: ligo/base:el7
  before_script:
    - yum install -yq
          rpm-build
          epel-rpm-macros
          python-rpm-macros
          python3-rpm-macros
          python-setuptools
          python34-setuptools
  script:
    - python setup.py sdist
    - rpmbuild -tb dist/ligo-gracedb*.tar.gz
    - mv -v ~/rpmbuild/RPMS/*/python*-ligo-gracedb-*.rpm dist/
    - rm -rf dist/*.tar.gz

.build:debian: &build_debian
  <<: *build
  before_script:
    - apt-get update -yqq
    - apt-get install -yq
          dpkg-dev
          debhelper
          dh-python
          python-all-dev
          python3-all-dev
          python-setuptools
          python3-setuptools
          python-six
          python3-six
          help2man
  script:
    - pushd .
    - python setup.py sdist
    - version=$(python setup.py --version)
    - cd dist
    - tar -xf ligo-gracedb-${version}.tar.gz
    - cd ligo-gracedb-${version}
    - dpkg-buildpackage -us -uc -b
    - popd
    - rm -rf dist/ligo-gracedb*

build:debian:jessie:
  <<: *build_debian
  image: debian:jessie

build:debian:stretch:
  <<: *build_debian
  image: debian:stretch
Duncan Macleod's avatar
Duncan Macleod committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

# -- test -------------------

.test: &test
  stage: test
  image: python
  before_script:
    - python -m pip install .
  script:
    - python -c "import ligo.gracedb"
    - gracedb --help

test:python2.7:
  <<: *test
  image: python:2.7

test:python3.6:
  <<: *test
  image: python:3.6