For this activity, we are going to use the gitlab environment to set up a CI (Continuous Integration) test environment.
Download and create a file named exactly .gitlab-ci.yml
at the top level of your directory. Note that you will have to rename the downloaded file to add a .
at as the first character of the name!
Below, we show the content in the file
image: name: kalrabb/docker-swen-250-identifier-convention-chkr-img:latest variables: PROJECT_FOLDER: Filter #Change this to your current folder/ project BUILD_CMD: make #If you don't have a Makefile, put the build command here RUN_CMD: valgrind --leak-check=full ./test #Assume the executable file is called 'test' before_script: - cat /etc/lsb-release - which gcc - which g++ - which valgrind - which make - cd $PROJECT_FOLDER - pwd - ulimit -n 1048576 - ulimit -a testrunner: script: - $BUILD_CMD #Runs make, or custom command - $RUN_CMD #Runs the executable against valgrind - echo "**Done**" stage: test
Review the .yml file, and check the names for the $PROJECT_FOLDER, $BUILD_CMD and $RUN_CMD. The sample is set up for the assignment Filter
. For other assignments, you would need to change those variables to match the correct values.
Save the file, and run git status
. You should see the new .gitlab-ci.yml file
Go ahead and add, commit, push the file.
Go to gitlab, and find the CI/ CD menu (in the left side menu-bar)
You should see a button saying (hopefully) running or completed. Click on the button and look at the output