diff --git a/ci_cd/lab0.yml b/ci_cd/lab0.yml index 9827fcecda532af6e579d04fca47f663f4151362..0e3d46dadbeb22c67a34f16dae52125144ffe97c 100644 --- a/ci_cd/lab0.yml +++ b/ci_cd/lab0.yml @@ -56,7 +56,6 @@ test_lab_0: - echo "Testing Lab 0"; - cp lab0.o base_0/tests - cd base_0/tests - - make test - - ./test + - make lab0 needs: [lint_lab_0] tags: [c++-17] \ No newline at end of file diff --git a/ci_cd/lab1.yml b/ci_cd/lab1.yml new file mode 100644 index 0000000000000000000000000000000000000000..98c07dd597f188b9228124806807f53e497eabcd --- /dev/null +++ b/ci_cd/lab1.yml @@ -0,0 +1,61 @@ +stages: + - prebuild + - compile + - lint + - test + +.only_run_if_lab0_available: &common_rules_1 + rules: + - changes: + - lab1.cpp + +### Lab 0 +prebuild_lab_1: + stage: prebuild + <<: *common_rules_1 + script: + - git clone https://agile.bu.edu/gitlab/configs/ec327/lab-configs/current.git base_1 + when: on_success # only runs if the previous stage succeeds + artifacts: + paths: + - base_1 + - lab1.cpp + tags: [c++-17] + +compile_lab_1: + stage: compile + <<: *common_rules_1 + script: + - echo "Compiling lab1.cpp" + - g++ -c lab1.cpp + artifacts: + paths: + - base_1 + - lab1.* + needs: [prebuild_lab_1] + tags: [c++-17] + +lint_lab_1: + stage: lint + <<: *common_rules_1 + script: + - echo "Static code check of lab1.cpp" + - cppcheck --check-config --enable=all --inconclusive --error-exitcode=1 lab1.cpp tests/LabOne.cpp + allow_failure: false + needs: [compile_lab_0] + artifacts: + paths: + - base_1 + - lab0.* + tags: [cppcheck] + +test_lab_1: + stage: test + <<: *common_rules_1 + script: + - echo "Testing Lab 1"; + - cp lab1.o base_1/tests + - cd base_1/tests + - make lab1 + needs: [lint_lab_0] + tags: [c++-17] \ No newline at end of file