stages:
  - test

noether-rocm:
  stage: test
  tags:
    - rocm
  image: jedbrown/rocm:latest
  script:
    - export COVERAGE=1 gcov=gcov-8 CC=gcc-8 CXX=gcc-8 FC=gfortran-8
    - make info
    - make -j$(nproc)
    - echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
    - make -k -j$(nproc) junit realsearch=%
    - export SUCCESS=1
  after_script:
    - |
      if [ SUCCESS == 1 ]; then
        lcov --directory . --capture --output-file coverage.info;
        bash <(curl -s https://codecov.io/bash) -f coverage.info -F interface;
        bash <(curl -s https://codecov.io/bash) -f coverage.info -F gallery;
        bash <(curl -s https://codecov.io/bash) -f coverage.info -F backends;
        bash <(curl -s https://codecov.io/bash) -f coverage.info -F tests;
        bash <(curl -s https://codecov.io/bash) -f coverage.info -F examples;
      fi
  artifacts:
    paths:
      - build/*.junit
    reports:
      junit: build/*.junit
      performance: performance.json
