11stages :
22 - build
33 - test
4- - production
54
65variables :
76 CCACHE_BASEDIR : $CI_PROJECT_DIR
87 CCACHE_DIR : $CI_PROJECT_DIR/ccache
98 GIT_CLEAN_FLAGS : none
109
1110cache :
12- key : ccache_main
11+ key : ccache
1312 paths :
1413 - $CCACHE_DIR
1514
16-
1715build-job :
1816 stage : build
1917 rules :
2018 - changes :
21- - (exclude)README.md
22- - (exclude)scripts/**/*
23- - (exclude)doc/**/*
24- when : never
25- - if : ' $CI_COMMIT_MESSAGE =~ /\[ci.skip\]/'
26- when : never
27- - if : ' $CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/'
28- when : always
29- - if : ' $CI_PIPELINE_SOURCE == "merge_request_event"'
30- when : always
31- - if : ' $CI_COMMIT_REF_NAME == "main" && ($CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/) && $CI_COMMIT_MESSAGE !~ /\[ci.skip\]/'
32- when : always
19+ - (exclude)README.md
20+ - (exclude)scripts/**/*
21+ - (exclude)doc/**/*
3322
3423 before_script :
3524 - export CCACHE_BASEDIR="$PWD"
3625 - export CCACHE_DIR="$PWD/ccache"
3726 - export CCACHE_COMPILERCHECK=content
27+ - if [ -f "$CI_PROJECT_DIR/ccache.tar.gz" ]; then tar -xzf "$CI_PROJECT_DIR/ccache.tar.gz" -C $CCACHE_DIR; fi
28+ - mkdir -p $CCACHE_DIR
3829 - ccache --zero-stats || true
3930 - ccache --show-stats || true
4031 - git clean -ffdx
@@ -44,53 +35,50 @@ build-job:
4435 - echo $PATH
4536 - nvidia-smi
4637 - which nvcc
47- - mkdir build
38+ - mkdir -p build
4839 - cd build
4940 - cmake -DApps_BUILD_TESTS=ON -DKokkos_CUDA_ARCH_NAME=Kokkos_ARCH_VOLTA70 ..
5041 - make
51- - echo "Compile complete."
52-
42+
5343 after_script :
5444 - export CCACHE_DIR="$PWD/ccache"
5545 - ccache --show-stats || true
46+ - tar -czf ${CCACHE_DIR}/ccache.tar.gz $CCACHE_DIR
47+ - mv ${CCACHE_DIR}/ccache.tar.gz $CI_PROJECT_DIR/
48+
49+ artifacts :
50+ paths :
51+ - build
52+ - ${CCACHE_DIR}/ccache.tar.gz
5653
5754test-job :
5855 stage : test
5956 rules :
6057 - changes :
61- - (exclude)README.md
62- - (exclude)scripts/**/*
63- - (exclude)doc/**/*
64- when : never
65- - if : ' $CI_COMMIT_MESSAGE =~ /\[ci.skip\]/'
58+ - (exclude)README.md
59+ - (exclude)scripts/**/*
60+ - (exclude)doc/**/*
6661 when : never
67- - if : ' $CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/ '
68- when : always
69- - if : ' $CI_COMMIT_MESSAGE =~ /\[ci test\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.test\]/ '
70- when : always
71- - if : ' $CI_PIPELINE_SOURCE == "merge_request_event" '
72- when : always
73- - if : ' $CI_COMMIT_REF_NAME == "main" && ($CI_COMMIT_MESSAGE =~ /\[ci test\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.test\]/) && ($CI_COMMIT_MESSAGE =~ /\[ci build\]/ || $CI_COMMIT_MESSAGE =~ /\[ci.build\]/) && $CI_COMMIT_MESSAGE !~ /\[ci.skip\]/ '
74- when : always
62+
63+ dependencies :
64+ - build-job
65+
66+ before_script :
67+ - export CCACHE_DIR="$PWD/ccache"
68+ - mkdir -p $CCACHE_DIR
69+ - tar -xzf ${CCACHE_DIR}/ccache.tar.gz -C $CCACHE_DIR || true
7570
7671 script :
7772 - echo $PWD
7873 - base_path=$PWD
7974 - echo "Entering $PWD/apps/src/tests to run apps unit tests"
8075 - cd ${base_path}/apps/src/tests
81- - ${base_path}/build/Libra/apps/src/ tests/LibRATests --gtest_output="report.xml"
82- - python -m pytest --junitxml=pytest_report.xml
76+ - ${base_path}/install/bin/ tests/LibRATests --gtest_output="xml:${base_path}/apps/src/tests/ report.xml"
77+ - python -m pytest --junitxml=${base_path}/apps/src/tests/ pytest_report.xml
8378
8479 artifacts :
8580 when : always
8681 reports :
87- junit : ./report.xml
88- junit : ./pytest_report.xml
89-
90- production-job :
91- stage : production
92- only :
93- - manual
94- script :
95- - echo "Deploying to production..."
96- # Add your deployment commands here
82+ junit :
83+ - ${base_path}/apps/src/tests/report.xml
84+ - ${base_path}/apps/src/tests/pytest_report.xml
0 commit comments