Skip to content
Snippets Groups Projects
Code owners
problem4.yml 1.37 KiB
prebuild_problem_4:
  stage: problem4
  script:
    - |
      # Check if problem4.cpp exists
      if [ ! -f "problem4.cpp" ]; then
        echo "problem4.cpp does not exist";
        exit 1;
      fi
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem4"'
  tags: [shell]

prebuild_problem_4_SKIP:
  stage: problem4
  script:
    - echo "SKIPPING problem 4 checks because the branch name is not 'problem4'"
  rules:
    - if: '$CI_COMMIT_REF_NAME != "problem4"'
  tags: [shell]

compile_problem_4:
  stage: problem4
  script:
    - echo "Compiling problem4.cpp"
    - git clone https://agile.bu.edu/gitlab/configs/ec327/hw-configs/hw3.git base_3
    - cp problem4.cpp base_3/tests
    - cd base_3/tests
    - make problem4
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem4"'
  tags: [c++-17]

lint_problem_4:
  stage: problem4
  script:
    - echo "Static code check of problem4.cpp"
    - cppcheck --check-config --enable=all --inconclusive --error-exitcode=1 problem4.cpp
  allow_failure: false
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem4"'
  tags: [cppcheck]

test_problem_4:
  stage: problem4
  script:
    - echo "Testing problem 4";
    - git clone https://agile.bu.edu/gitlab/configs/ec327/hw-configs/hw3.git base_3
    - cp problem4.cpp base_3/tests
    - cd base_3/tests
    - make problem4
    - ./problem4
  rules:
    - if: '$CI_COMMIT_REF_NAME == "problem4"'
  tags: [c++-17]