default:
  image: registry.app.unistra.fr/alain/dockers/gcc

stages:
  - build
  - test
  - deploy
  - final

compile-job:
  stage: build
  script:
    - echo "Compiling the project..."
    - gcc -c c-check/interval.c
  artifacts:
    paths:
      - interval.o

test-job:
  stage: test
  script:
    - echo "Testing..."
    - gcc -c c-check/test_interval.c -lcheck -lm -lsubunit
    - gcc -o test_interval interval.o test_interval.o -lcheck -lm -lsubunit
    - ./test_interval
  dependencies:
    - compile-job

pages:
  stage: deploy
  script:
    - echo "Deploying..."
    - cd c-check
    - doxygen -g
    - doxygen Doxyfile
    - mv html ../public
  artifacts:
    paths:
      - public

final-job:
  stage: final
  script:
    - echo "All done"