diff --git a/ci_cd/.gitlab-ci.yml b/ci_cd/.gitlab-ci.yml index 1d1166cfb59df6c77cebc6e73537e0a19e36af40..08a63b33d6637cde38484a3473d94529b8024c88 100644 --- a/ci_cd/.gitlab-ci.yml +++ b/ci_cd/.gitlab-ci.yml @@ -1,8 +1,13 @@ stages: - - prebuild - - compile - - lint - - test + - labm1 + - lab0 + - lab1 + +#stages: +# - prebuild +# - compile +# - lint +# - test include: - local: 'ci_cd/labm1.yml' # Lab -1 diff --git a/ci_cd/lab0.yml b/ci_cd/lab0.yml index 0e3d46dadbeb22c67a34f16dae52125144ffe97c..12c4403c51c3cfeca62e5f99aecbddf04290d3aa 100644 --- a/ci_cd/lab0.yml +++ b/ci_cd/lab0.yml @@ -1,18 +1,6 @@ -stages: - - prebuild - - compile - - lint - - test - -.only_run_if_lab0_available: &common_rules_0 - rules: - - changes: - - lab0.cpp - ### Lab 0 prebuild_lab_0: - stage: prebuild - <<: *common_rules_0 + stage: lab0 script: - git clone https://agile.bu.edu/gitlab/configs/ec327/lab-configs/current.git base_0 when: on_success # only runs if the previous stage succeeds @@ -20,11 +8,13 @@ prebuild_lab_0: paths: - base_0 - lab0.cpp + rules: + - changes: + - lab0.cpp tags: [c++-17] compile_lab_0: - stage: compile - <<: *common_rules_0 + stage: lab0 script: - echo "Compiling lab0.cpp" - g++ -c lab0.cpp @@ -36,8 +26,7 @@ compile_lab_0: tags: [c++-17] lint_lab_0: - stage: lint - <<: *common_rules_0 + stage: lab0 script: - echo "Static code check of lab0.cpp" - cppcheck --check-config --enable=all --inconclusive --error-exitcode=1 lab0.cpp tests/LabZero.cpp @@ -50,8 +39,7 @@ lint_lab_0: tags: [cppcheck] test_lab_0: - stage: test - <<: *common_rules_0 + stage: lab0 script: - echo "Testing Lab 0"; - cp lab0.o base_0/tests diff --git a/ci_cd/lab1.yml b/ci_cd/lab1.yml index c33dced643746da60ae11f044b4edccb91a7c711..a380d0a90b446129338656fe569d41a1224269c2 100644 --- a/ci_cd/lab1.yml +++ b/ci_cd/lab1.yml @@ -1,18 +1,6 @@ -stages: - - prebuild - - compile - - lint - - test - -.only_run_if_lab1_available: &common_rules_1 - rules: - - changes: - - lab1.cpp - ### Lab 1 prebuild_lab_1: - stage: prebuild - <<: *common_rules_1 + stage: lab1 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 @@ -20,11 +8,13 @@ prebuild_lab_1: paths: - base_1 - lab1.cpp + rules: + - changes: + - lab1.cpp tags: [c++-17] compile_lab_1: - stage: compile - <<: *common_rules_1 + stage: lab1 script: - echo "Compiling lab1.cpp" - g++ -c lab1.cpp @@ -36,8 +26,7 @@ compile_lab_1: tags: [c++-17] lint_lab_1: - stage: lint - <<: *common_rules_1 + stage: lab1 script: - echo "Static code check of lab1.cpp" - cppcheck --check-config --enable=all --inconclusive --error-exitcode=1 lab1.cpp tests/LabOne.cpp @@ -50,8 +39,7 @@ lint_lab_1: tags: [cppcheck] test_lab_1: - stage: test - <<: *common_rules_1 + stage: lab1 script: - echo "Testing Lab 1"; - cp lab1.o base_1/tests diff --git a/ci_cd/labm1.yml b/ci_cd/labm1.yml index 821ba43ed242f573f53d104850b7022d986b9725..fb7e3f8ee0c47be512c3b83cb987cdd2abaa1917 100644 --- a/ci_cd/labm1.yml +++ b/ci_cd/labm1.yml @@ -1,29 +1,19 @@ -stages: - - prebuild - - compile - - lint - - test - -.only_run_if_lab-1_available: &common_rules_m1 - rules: - - changes: - - lab-1.cpp - ### Lab -1 prebuild_lab_m1: - stage: prebuild - <<: *common_rules_m1 + stage: labm1 script: - | if [ ! -f 'lab-1.cpp' ]; then echo "ERROR - could not find file lab-1.cpp"; exit 1; fi + rules: + - changes: + - lab-1.cpp tags: [shell] compile_lab_m1: - stage: compile - <<: *common_rules_m1 + stage: labm1 script: - echo "Compiling lab-1.cpp" - g++ -c lab-1.cpp @@ -31,8 +21,7 @@ compile_lab_m1: tags: [c++-17] lint_lab_m1: - stage: lint - <<: *common_rules_m1 + stage: labm1 script: - echo "Static code check of lab-1.cpp" - cppcheck --enable=all --inconclusive --error-exitcode=1 lab-1.cpp @@ -42,7 +31,7 @@ lint_lab_m1: # don't run the test in the master branch test_lab_m1: - stage: test + stage: labm1 rules: - if: '$CI_COMMIT_BRANCH != "master" && $CI_COMMIT_TAG == null' script: