Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
default:
image: gcc:latest
stages:
- build
- test
- final
compile-job:
stage: build
script:
- echo "Compiling the project..."
- gcc -c main.c
- gcc -c utils.c
- gcc -o main main.o utils.o
artifacts :
paths:
- utils.o
test-job:
stage: test
script:
- echo "Running tests..."
- gcc -c test_utils.c
- gcc -c utils.c
- gcc -o test_utils test_utils.o utils.o
- ./test_utils
dependencies:
- compile-job
test-job-2:
stage: test
script:
- echo "Running tests for test_commut..."
- gcc -c test_commut.c
- gcc -o test_commut test_commut.o utils.o # Use utils.o from the artifact
- ./test_commut
dependencies:
- compile-job # Use the utils.o artifact from compile-job
final-job:
stage: final # Define the new final job in the final stage
script:
- echo "All done" # Simple job script to indicate completion