default.yml 2.11 KB
Newer Older
1
2
3
4
default:
  image: $IMAGE

stages:
Dennis Gläser's avatar
Dennis Gläser committed
5
  - configure
6
7
8
9
10
11
12
  - build
  - test

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE=="parent_pipeline"

Dennis Gläser's avatar
Dennis Gläser committed
13
14
select tests:
  stage: configure
15
  before_script:
16
    - |
Dennis Gläser's avatar
Dennis Gläser committed
17
18
19
20
      DUMUX_CLONE_BRANCH=master
      if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
        DUMUX_CLONE_BRANCH=${DUMUX_MR_BRANCH}
        echo "Received upstream merge request branch ${DUMUX_MR_BRANCH}"
21
      fi
Dennis Gläser's avatar
Dennis Gläser committed
22
23
    - echo "Checking out branch ${DUMUX_CLONE_BRANCH} in dumux"
    - git clone -b ${DUMUX_CLONE_BRANCH} --depth 1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
24
    - dunecontrol --opts=$DUNE_OPTS_FILE --only=dumux all
25
  script:
Dennis Gläser's avatar
Dennis Gläser committed
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
    - |
      dunecontrol --opts=$DUNE_OPTS_FILE --current all
      if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
          python3 dumux/bin/testing/getchangedfiles.py -o changedfiles.txt -t origin/$DUMUX_MR_BRANCH
          python3 dumux/bin/testing/findtests.py -o affectedtests.json --file-list changedfiles.txt
      else
          echo "Skipping test selection, build/test stages will consider all tests!"
          echo "{}" >> affectedtests.json
      fi
  artifacts:
    paths:
      - dumux
      - build-cmake
      - affectedtests.json
    expire_in: 3 hours

build lecture:
  stage: build
  script:
    - |
      pushd build-cmake
        make clean
        if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
          python3 ../dumux/bin/testing/runselectedtests.py -c ../affectedtests.json -b
        else
          python3 ../dumux/bin/testing/runselectedtests.py --all -b
        fi
      popd
54
55
56
  artifacts:
    paths:
      - build-cmake
57
      - dumux
Dennis Gläser's avatar
Dennis Gläser committed
58
      - affectedtests.json
59
60
61
62
    expire_in: 3 hours

test lecture:
  stage: test
Dennis Gläser's avatar
Dennis Gläser committed
63
64
65
  variables:
    OMPI_ALLOW_RUN_AS_ROOT: 1
    OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
66
  script:
Dennis Gläser's avatar
Dennis Gläser committed
67
68
69
70
71
72
73
74
    - |
      pushd build-cmake
        if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
          python3 ../dumux/bin/testing/runselectedtests.py -c ../affectedtests.json -t
        else
          python3 ../dumux/bin/testing/runselectedtests.py --all -t
        fi
      popd
75
76
77
  needs:
    - job: build lecture
      artifacts: true
78
79
80
  artifacts:
    reports:
      junit: junit/dumux-lecture-cmake.xml