image: anddebol/pbl-tests:latest
stages:          # List of stages for jobs, and their order of execution
  - build
  - test

build-job:       # This job runs in the build stage, which runs first.
  stage: build
  script:
    - echo "Compiling the code..."
    - mkdir build && cd build
    - >-   
        cmake -DCMAKE_C_COMPLER=gcc -DCMAKE_CXX_COMPILER=g++ 
        -DCMAKE_Fortran_COMPILER -S ..
    - make -j 4
    - echo "Compile complete."
  timeout: 10 minutes
  artifacts:
    paths:
        - build/CMakeCache.txt
        - build/inmcm_sfx


dry-run:   # This job runs in the test stage.
  stage: test    # It only starts when the job in the build stage completes successfully.
  script:
    - echo "Running unit tests... This will take about 60 seconds."
    - cd build
    - inmcm_sfx 
    - echo "Code coverage is 90%"
