stages:
  - validate
  - test

compile_test_shdlc:
    stage: test
    image:
        name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-arduino:0.5.0
    tags: [docker, linux]
    script:
        - tests/compile_test.py -s examples/AllCommandsShdlc/

compile_test_i2c:
    stage: test
    image:
        name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-arduino:0.5.0
    tags: [docker, linux]
    script:
        - tests/compile_test.py -s examples/AllCommandsI2c/

syntax_check:
  stage: validate
  image:
      name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-python:3.8-20.04-2.7.0
  tags: [linux, docker]
  before_script:
    # For performance and stability reasons, use offline installation.
    - pip install --no-index --find-links=/pip editorconfig-checker
    - pip install flake8
    - apt-get update && apt-get install -yq clang-format-6.0
  script:
    - tests/syntax_check.sh

cppcheck:
  stage: validate
  image: registry.gitlab.sensirion.lokal/sensirion/docker/docker-cppcheck:1.0.0
  tags: [linux, docker]
  script:
    - tests/run_cppcheck.sh
