-
Ari Trachtenberg authoredAri Trachtenberg authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
lab0.yml 2.25 KiB
### Lab 0
prebuild_lab_0:
stage: lab0
script:
- |
# Check if lab0.cpp exists
if [ ! -f "lab0.cpp" ]; then
echo "lab0.cpp does not exist";
exit 1;
fi
# Check if lab-1.cpp has been merged into master
git fetch origin master # Fetch the latest master branch
if git ls-tree -r origin/master --name-only | grep -q 'lab-1.cpp'; then
echo "Lab -1 complete";
else
echo "Please have lab -1 merged first";
exit 1;
fi
- git clone https://agile.bu.edu/gitlab/configs/ec327/lab-configs/current.git base_0
artifacts:
paths:
- base_0
rules:
- if: '$CI_COMMIT_REF_NAME == "lab0"'
tags: [c++-17]
prebuild_lab_0_SKIP:
stage: lab0
script:
- echo "SKIPPING Lab 0 checks because the branch name is not 'lab0'"
rules:
- if: '$CI_COMMIT_REF_NAME != "lab0"'
tags: [c++-17]
compile_lab_0:
stage: lab0
script:
- echo "Compiling lab0.cpp"
- g++ -c lab0.cpp
artifacts:
paths:
- base_0
rules:
- if: '$CI_COMMIT_REF_NAME == "lab0"'
dependencies:
- prebuild_lab_0
tags: [c++-17]
lint_lab_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
allow_failure: false
artifacts:
paths:
- base_0
rules:
- if: '$CI_COMMIT_REF_NAME == "lab0"'
dependencies:
- prebuild_lab_0
tags: [cppcheck]
test_lab_0:
stage: lab0
script:
- echo "Testing Lab 0";
- git clone https://agile.bu.edu/gitlab/configs/ec327/lab-configs/current.git base_0
- cp lab0.cpp base_0/tests
- cd base_0/tests
- make lab0
rules:
- if: '$CI_COMMIT_REF_NAME == "lab0"'
dependencies:
- compile_lab_0
tags: [c++-17]
# trigger internal tests only upon a merge request into master
internal_tests_lab_0:
stage: tests
script:
- git clone https://trachten-gitlab:$INTERNAL_LAB_TESTS@agile.bu.edu/gitlab/ec327/ec327-staff/lab-tests.git
- cp -f lab0.cpp lab-tests/internal_tests/
- cd lab-tests/internal_tests
- make lab0
rules:
- if: '$CI_COMMIT_REF_NAME == "lab0" && $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
tags: [ c++-17 ]