Skip to content
Snippets Groups Projects
Commit 236a459c authored by Olivier Levillain's avatar Olivier Levillain
Browse files

Initial commit.

parents
No related branches found
No related tags found
No related merge requests found
all: hello
# Third git exercise (c flavor)
In this series of exercises, we assume you are working as a team of
two: one of you is acting as a developer, the other as the project
maintainer.
To validate this exercise, you have to perform the following actions:
- [Maintainer] fork the project
- [Maintainer] enforce that only maintainers can merge into the main branch
- [Maintainer] enforce that no one can directly push into the main branch
- [Maintainer] invite your teammate as a developer on the project
- [Maintainer] also invite your teacher as a developer
- [Developer] Clone the repository
- [Developer] Identify the problem with this project and write an issue about it
- [Developer] Create a dedicated branch to fix the problem
- [Developer] Once you are happy with your work, propose a Merge Request
- [Maintainer] Review the proposal, and comment if need be
- [Developer] Improve your review following the maintainer's commnets
- [Maintainer] When the Merge Request seems acceptable, accept it into the main branch
If you have already validated this exercise and a similar one, both as
developer and as maintainer, here are some follow-up questions, to do
with your teammate:
- [Maintainer] Add a .gitlab-ci.yml file at the root of the project, with the following
content, with IMAGE being gcc for a C program or python:3.10 for python scripts (and
push it into the main branch)
```
test:
image: IMAGE
script:
- make check
```
- [Maintainer] Configure the repository so that a Merge Request can
only be accepted if the CI pipeline (the `make check` above) succeeds.
- [Maintainer] Look at the CI/CD
- [Developer] Write a Makefile and some tests in a dedicated branch
- [Developer] Once you are satisfied, fill a Merge Request
- [Maintainer] Try and validate the Merge Request. If it does not work, discuss with your dev.
hello.c 0 → 100644
#include <stdio.h>
void main(int argc, char* argv[]) {
if (argc < 2)
printf("Hello world!\n");
else if (argc == 2)
printf("Hello %s!\n", argv[1]);
else {
printf("Hello ");
printf(argv[1]);
for (int i=2; i < argc; i++)
printf(", %s", argv[i]);
printf("!\n");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment