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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
jobs:
- job: hera_cal
  pool:
    vmImage: "ubuntu-latest"
  variables:
    PYTHON: "3.9"
    ENV_NAME: hera_cal_tests
    WITH_SUDO: true

  steps:
  - bash: |
      cd ../
      git clone https://github.com/HERA-Team/hera_cal.git
      cd s
    displayName: clone hera_cal

  - bash: wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | sudo tar -C / -xvj bin/micromamba
    displayName: Install Micromamba

  - bash: |
      micromamba info
      # need these to add gxx and gcc to build novas and cython
      micromamba create --name=${ENV_NAME}  python=$PYTHON gxx gcc -f ../hera_cal/ci/${ENV_NAME}.yml -yq
    displayName: configure conda environment

  - bash: |
      source ./ci/_activate_current_env.sh
      micromamba list -n ${ENV_NAME}
      # check that the python version matches the desired one; exit immediately if not
      PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"`
      if [[ $PYVER != $PYTHON ]]; then
        exit 1;
      fi
    displayName: Verify Mamba Config

  - bash: |
      source ./ci/_activate_current_env.sh
      pip install --no-deps .
      cd ../hera_cal
      pip install --no-deps .
      mkdir test-reports
      python -m pytest hera_cal --junitxml=test-reports/xunit.xml
    displayName: run hera_cal tests

- job: hera_qm
  pool:
    vmImage: "ubuntu-latest"
  variables:
    PYTHON: "3.9"
    ENV_NAME: hera_qm_tests
    WITH_SUDO: true

  steps:
  - bash: |
      cd ../
      git clone https://github.com/HERA-Team/hera_qm.git
      cd s
    displayName: clone hera_qm

  - bash: wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | sudo tar -C / -xvj bin/micromamba
    displayName: Install Micromamba

  - bash: |
      micromamba info
      # need these to add gxx and gcc to build novas and cython
      micromamba create --name=${ENV_NAME}  python=$PYTHON gxx gcc -f ../hera_qm/ci/${ENV_NAME}.yml -yq
    displayName: configure conda environment

  - bash: |
      source ./ci/_activate_current_env.sh
      micromamba list -n ${ENV_NAME}
      # check that the python version matches the desired one; exit immediately if not
      PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"`
      if [[ $PYVER != $PYTHON ]]; then
        exit 1;
      fi
    displayName: Verify Mamba Config

  - bash: |
      source ./ci/_activate_current_env.sh
      pip install --no-deps .
      cd ../hera_qm
      pip install --no-deps .
      mkdir test-reports
      python -m pytest hera_qm --junitxml=test-reports/xunit.xml
    displayName: run hera_qm tests