|
| 1 | +# Use the latest 2.1 version of CircleCI pipeline process engine. |
| 2 | +# See: https://circleci.com/docs/2.0/configuration-reference |
| 3 | +version: 2.1 |
| 4 | +# Define a job to be invoked later in a workflow. |
| 5 | +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs |
| 6 | +jobs: |
| 7 | + build-and-test: |
| 8 | + # Specify the execution environment. |
| 9 | + # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor |
| 10 | + docker: |
| 11 | + - image: cimg/base:stable |
| 12 | + |
| 13 | + environment: |
| 14 | + CCACHE_COMPRESS: true |
| 15 | + CCACHE_COMPRESSLEVEL: 6 |
| 16 | + CCACHE_MAXSIZE: 450M |
| 17 | + |
| 18 | + resource_class: large |
| 19 | + |
| 20 | + # Add steps to the job |
| 21 | + # See: https://circleci.com/docs/2.0/configuration-reference/#steps |
| 22 | + steps: |
| 23 | + - checkout |
| 24 | + - run: |
| 25 | + name: "Pull Submodules" |
| 26 | + command: | |
| 27 | + git submodule update --init |
| 28 | +
|
| 29 | + - run: |
| 30 | + name: "Save environment" |
| 31 | + command: | |
| 32 | + echo CIRCLE_WORKING_DIRECTORY = ${CIRCLE_WORKING_DIRECTORY} |
| 33 | + echo export CCACHE_DIR="${CIRCLE_WORKING_DIRECTORY}/ccache" >> $BASH_ENV |
| 34 | +
|
| 35 | + - run: |
| 36 | + name: "Print environment" |
| 37 | + command: | |
| 38 | + echo 'export MY_ENV_VAR="FOO"' >> $BASH_ENV |
| 39 | + echo CCACHE_DIR = ${CCACHE_DIR} |
| 40 | + mkdir -p ${CCACHE_DIR} |
| 41 | +
|
| 42 | + - restore_cache: |
| 43 | + keys: |
| 44 | + - framework-ccache-{{ epoch }} |
| 45 | + - framework-ccache- |
| 46 | + |
| 47 | + - run: |
| 48 | + name: "Install packages" |
| 49 | + command: | |
| 50 | + sudo apt-get update |
| 51 | + sudo apt-get install -y apt-utils iputils-ping g++ python3 git gfortran libglib2.0-dev libxml2-dev libhdf5-openmpi-dev libparmetis-dev wget libgtest-dev libtbb-dev rsync swig4.0 libhypre-dev petsc-dev ninja-build ccache |
| 52 | + wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb |
| 53 | + sudo dpkg -i packages-microsoft-prod.deb |
| 54 | + sudo apt-get update |
| 55 | + sudo apt-get install -y apt-transport-https dotnet-sdk-6.0 |
| 56 | + wget https://github.com/Kitware/CMake/releases/download/v3.21.3/cmake-3.21.3-Linux-x86_64.tar.gz |
| 57 | + cp cmake-3.21.3-Linux-x86_64.tar.gz /tmp |
| 58 | + cd /tmp && tar xf cmake-3.21.3-Linux-x86_64.tar.gz |
| 59 | + echo "Listing of /tmp" |
| 60 | + ls -lart /tmp |
| 61 | + echo "Listing of /tmp/cmake-3.21.3-linux-x86_64" |
| 62 | + ls -lart /tmp/cmake-3.21.3-linux-x86_64 |
| 63 | + cd /tmp/cmake-3.21.3-linux-x86_64/ && sudo rsync -au . /usr/local |
| 64 | + ls -lart /usr/local/bin |
| 65 | + echo "Generate NuGet.config" |
| 66 | + mkdir -p /home/circleci/.nuget/NuGet |
| 67 | + cd /home/circleci/.nuget/NuGet && dotnet new nugetconfig |
| 68 | + ls -lart /home/circleci/.nuget/NuGet |
| 69 | + cd /home/circleci/.nuget/NuGet && mv nuget.config NuGet.config |
| 70 | + echo "Print NuGet.config" |
| 71 | + cat /home/circleci/.nuget/NuGet/NuGet.config |
| 72 | +
|
| 73 | + - run: |
| 74 | + name: "Print tools versions" |
| 75 | + command: | |
| 76 | + echo 'CMake version:' |
| 77 | + cmake --version |
| 78 | + echo 'ccache version:' |
| 79 | + ccache --version |
| 80 | + ccache -z |
| 81 | +
|
| 82 | + - run: |
| 83 | + name: Configure 'framework' |
| 84 | + command: | |
| 85 | + cmake -S "_common/build_all" -B build -DCMAKE_CXX_FLAGS_RELEASE="-O2" -DCMAKE_VERBOSE_MAKEFILE=TRUE -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=TRUE -DARCANE_DEFAULT_PARTITIONER=Metis -DARCCON_REGISTER_PACKAGE_VERSION=2 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -GNinja |
| 86 | +
|
| 87 | + - run: |
| 88 | + name: Build 'framework' |
| 89 | + command: | |
| 90 | + cmake --build build |
| 91 | +
|
| 92 | + - run: |
| 93 | + name: Get 'ccache' status |
| 94 | + command: | |
| 95 | + ccache -s |
| 96 | +
|
| 97 | + - save_cache: |
| 98 | + key: framework-ccache-{{ epoch }} |
| 99 | + when: always |
| 100 | + paths: |
| 101 | + - ccache |
| 102 | + |
| 103 | +# On ne lance pas les tests qui utilisent 'mpithread' car ils ont besoin de 12 coeurs |
| 104 | +# sur les machines à 4 coeurs cela pose problème. |
| 105 | + - run: |
| 106 | + name: Test 'framework' |
| 107 | + command: | |
| 108 | + mkdir test_results |
| 109 | + echo BEFORE_PWD = `pwd` |
| 110 | + cd build && ctest --output-junit ../test_results/results.xml --output-on-failure -E mpithread |
| 111 | + echo AFTER_PWD = `pwd` |
| 112 | + ls -al ../test_results |
| 113 | +
|
| 114 | + - store_test_results: |
| 115 | + path: test_results |
| 116 | + |
| 117 | + - store_artifacts: |
| 118 | + path: test_results |
| 119 | + |
| 120 | +# Invoke jobs via workflows |
| 121 | +workflows: |
| 122 | + ubuntu-workflow: |
| 123 | + jobs: |
| 124 | + - build-and-test |
0 commit comments