variables:
  CI: "true"

default:
  image: julia:latest
  tags:
    - docker

Testing:
  script:
    - apt-get update
    - apt-get install -y xvfb
    - xvfb-run julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)'
  after_script:
    - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; c, t = get_summary(process_folder()); using Printf; @printf "Test coverage %.2f%%\n" 100c / t'
  timeout: 2h
  rules:
    - if:   $CI_PIPELINE_SOURCE == "merge_request_event"
      when: never
    - if:   $CI_COMMIT_TAG != null
      when: never
    - when: always

build_pages:
  script:
    - apt-get update
    - apt-get install -y git
    - julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); include("docs/make.jl")'
  rules:
    - if:   $CI_PIPELINE_SOURCE == "merge_request_event"
      when: never
    - when: always
