.gitlab-ci.yml 1.28 KB
Newer Older
Babouh's avatar
Babouh committed
1
2
3
4
5
stages:
  - lint
  - test

default:
6
  image: python:3.8
Babouh's avatar
Babouh committed
7
8
  tags:
    - docker_dio
9
10

.setup:
Babouh's avatar
Babouh committed
11
12
13
14
15
16
17
18
  before_script:
    - python --version
    - pip install poetry
    - poetry --version
    - poetry config virtualenvs.in-project true --local

lint-job:
  stage: lint
Lion Sonny's avatar
Lion Sonny committed
19
  needs: []
20
21
  before_script:
    - !reference [.setup, before_script]
22
    # install pre-commit
Babouh's avatar
Babouh committed
23
    - poetry run pip install pre-commit
24
  script:
25
    # run pre-commit
Babouh's avatar
Babouh committed
26
    - poetry run pre-commit run -a
Babouh's avatar
Babouh committed
27
28
29

test-job:
  stage: test
Lion Sonny's avatar
Lion Sonny committed
30
  needs: []
31
  variables:
Babouh's avatar
Babouh committed
32
    CDF_URL: 'https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/cdf38_1/cdf38_1-dist-all.tar.gz'
33
34
35
  before_script:
    - !reference [.setup, before_script]
    # install cdf and spacepy.pycdf
Babouh's avatar
Babouh committed
36
37
    - apt-get update
    - apt-get install -y gfortran ncurses-dev
38
39
40
41
42
43
    - wget $CDF_URL
    - tar -xf cdf38_1-dist-all.tar.gz && cd ./cdf38_1-dist
    - make OS=linux ENV=gnu CURSES=yes FORTRAN=no UCOPTIONS=-O2 SHARED=yes all
    - make install
    # install maser data
    - cd .. && poetry install
Babouh's avatar
Babouh committed
44
  script:
45
46
    # source the CDF lib and run the test
    - . ./cdf38_1-dist/bin/definitions.B
Babouh's avatar
Babouh committed
47
    - poetry run pytest --cov=maser.data --junitxml=report.xml -m "not test_data_required"
Babouh's avatar
Babouh committed
48
49
50
51
52
53
    - poetry run coverage xml
  artifacts:
    when: always
    reports:
      junit: report.xml
      cobertura: coverage.xml