.gitlab-ci.yml 1.79 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

# -- 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
Duncan Macleod's avatar
Duncan Macleod committed
33 34
          python2-six
          python34-six
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 72 73
  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
74 75 76 77 78 79 80

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

.test: &test
  stage: test
  image: python
  script:
81
    - python setup.py test
Duncan Macleod's avatar
Duncan Macleod committed
82 83 84 85 86

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

87 88 89 90 91 92 93 94
test:python3.4:
  <<: *test
  image: python:3.4

test:python3.5:
  <<: *test
  image: python:3.5

Duncan Macleod's avatar
Duncan Macleod committed
95 96 97
test:python3.6:
  <<: *test
  image: python:3.6
98 99 100 101

test:python3.7:
  <<: *test
  image: python:3.7