diff --git a/.gitlab/ci/release/cibuildwheel_windows.gitlab-ci.yml b/.gitlab/ci/release/cibuildwheel_windows.gitlab-ci.yml index 9f2c874c71e2dc5cd72a7ab8868ca9875b6d4f6c..8ca33bc026d83476ba6450679fc9e2a3ab551eea 100644 --- a/.gitlab/ci/release/cibuildwheel_windows.gitlab-ci.yml +++ b/.gitlab/ci/release/cibuildwheel_windows.gitlab-ci.yml @@ -5,11 +5,14 @@ release:pip:windows: extends: .release:pip:template image: mcr.microsoft.com/powershell:latest tags: - - windows + - windows + + # temporary rules until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/136 is closed + rules : + - when : never needs: - build:windows_python - - test:windows_python parallel: matrix: @@ -39,5 +42,6 @@ release:pip:windows: deploy:pip:windows: + allow_failure: true # temporary rules until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/136 is closed extends: - .deploy:pip:windows:template diff --git a/.gitlab/ci/release/template.gitlab-ci.yml b/.gitlab/ci/release/template.gitlab-ci.yml index 40f63a798302f1bcd3240484edc1608009d5f7fd..bccf820cc73ff36d9e9021b5e2024df8aede9619 100644 --- a/.gitlab/ci/release/template.gitlab-ci.yml +++ b/.gitlab/ci/release/template.gitlab-ci.yml @@ -26,7 +26,7 @@ include: - origin:eclipse # allow to target eclipse runner that holds the key for pypi upload image : eclipsecbi/buildpack-deps extends: - - .rules:release + - .rules:deploy - .secrets # given by the file included just above id_tokens: VAULT_ID_TOKEN: @@ -56,8 +56,10 @@ include: needs: [release:pip:ubuntu] extends: - .deploy:template + - .rules:deploy .deploy:pip:windows:template: needs: [release:pip:windows] extends: - .deploy:template + - .rules:deploy diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 54cb744f6073c3af32b70ac8e37b713315bf53e8..15b81f20064ab7648396e3973d0da6bacded5f0a 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1,22 +1,32 @@ .rules:static_analysis_coverage: rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TITLE !~ /^Draft:/ - when: always + when: on_success allow_failure: false - - when: manual - - allow_failure: true + when: manual + allow_failure: true .rules:build:merge_pipeline: rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TITLE !~ /^Draft:/ + allow_failure: false when: always - - when: manual - - allow_failure: false + when: manual + allow_failure: true +# creating release jobs only when merging to main .rules:release: rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_COMMIT_TAG + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - allow_failure: false + - if: $CI_COMMIT_TAG && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + allow_failure: false + +# deploying created releases +# when creating a commit tag & previous release job was successful +.rules:deploy: + rules: + - if: $CI_COMMIT_TAG + allow_failure: false + when: on_success diff --git a/.gitlab/ci/static_analysis/cpp.gitlab-ci.yml b/.gitlab/ci/static_analysis/cpp.gitlab-ci.yml index 11108569c913a56bfc6bfb9325a72045420f990b..3e1c35b08416fd2d89f15341b24bd5dcdd23b88c 100644 --- a/.gitlab/ci/static_analysis/cpp.gitlab-ci.yml +++ b/.gitlab/ci/static_analysis/cpp.gitlab-ci.yml @@ -6,12 +6,16 @@ static_analysis:cpp: extends: .rules:static_analysis_coverage tags: - static_analysis + before_script : + - apt-get update + - apt-get install -y cppcheck python-is-python3 python3-pip + - python -m pip install Pygments + - python -m pip install -U cppcheck_codequality + script: - mkdir -p $CI_COMMIT_REF_NAME - cppcheck -j 4 --enable=all --inconclusive --force --xml --xml-version=2 . 2> cppcheck-result.xml - - python -m pip install Pygments - cppcheck-htmlreport --file=cppcheck-result.xml --report-dir=$CI_COMMIT_REF_NAME --source-dir=src - - python3 -m pip install -U cppcheck_codequality - cppcheck-codequality --input-file=cppcheck-result.xml --output-file=cppcheck.json - mkdir -p public/cpp - mv $CI_COMMIT_REF_NAME public/cpp/ diff --git a/.gitlab/ci/static_analysis/python.gitlab-ci.yml b/.gitlab/ci/static_analysis/python.gitlab-ci.yml index ff63f9179dec89b6148ddf79f323d0c1f21707a2..d8690344cee04e15f0196671bab7a379d8b7ee59 100644 --- a/.gitlab/ci/static_analysis/python.gitlab-ci.yml +++ b/.gitlab/ci/static_analysis/python.gitlab-ci.yml @@ -6,9 +6,17 @@ static_analysis:python: extends: .rules:static_analysis_coverage tags: - static_analysis + before_script: + - apt-get update + - apt-get install -y python-is-python3 python3-pip + - python -m pip install pylint pylint-gitlab script: - - pip install pylint - - pip install pylint-gitlab + - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME + - echo $CI_DEFAULT_BRANCH + - echo $CI_PIPELINE_SOURCE + - echo $CI_COMMIT_BRANCH + - echo $CI_COMMIT_TAG + - pylint --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter ${CI_PROJECT_NAME}/ > codeclimate.json - pylint --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter ${CI_PROJECT_NAME}/ > pylint.html - mkdir -p public/python/$CI_COMMIT_REF_NAME diff --git a/.gitlab/ci/ubuntu_cpp.gitlab-ci.yml b/.gitlab/ci/ubuntu_cpp.gitlab-ci.yml index 1a599060d301772800dac37abbd6f61acba2e1da..7b33d51fbda24613c100983ffd1233e4cf47c46c 100644 --- a/.gitlab/ci/ubuntu_cpp.gitlab-ci.yml +++ b/.gitlab/ci/ubuntu_cpp.gitlab-ci.yml @@ -44,7 +44,8 @@ build:ubuntu_cpp: extends: .build:ubuntu_cpp:template script: - cd $BUILD_DIR - - cmake -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -DCOVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DPYBIND=0 .. + # WERROR=OFF until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/137 is not closed + - cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DCOVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DPYBIND=0 .. - make -j4 all install @@ -60,11 +61,11 @@ build:ubuntu_cpp:g++: matrix: - Gplusplus_VERSION: ["10","12"] script: - - echo "Build directory :$BUILD_DIR" - cd $BUILD_DIR - apt-get install -y g++-$Gplusplus_VERSION - - export CXX=/usr/bin/g++-$Gplusplus_VERSION - - cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=ON -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. + - export CXX=/usr/bin/g++-$Gplusplus_VERSION + # WERROR=OFF until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/137 is not closed + - cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. - make -j4 all install build:ubuntu_cpp:clang: @@ -79,11 +80,10 @@ build:ubuntu_cpp:clang: matrix: - CLANG_VERSION: ["12","15"] script: - - echo "Build directory :$BUILD_DIR" - cd $BUILD_DIR - apt-get install -y clang-$CLANG_VERSION - - export CXX=/usr/bin/clang++-$CLANG_VERSION - - cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=ON -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. + # WERROR=OFF until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/137 is not closed + - cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-$CLANG_VERSION -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. - make -j4 all install diff --git a/.gitlab/ci/ubuntu_python.gitlab-ci.yml b/.gitlab/ci/ubuntu_python.gitlab-ci.yml index 6d0a0f355577dd2fe6e32216b39aa77d33f4bd3a..e881c3ff97b2cf8f8be2e8f4bca00621426cc6a8 100644 --- a/.gitlab/ci/ubuntu_python.gitlab-ci.yml +++ b/.gitlab/ci/ubuntu_python.gitlab-ci.yml @@ -50,7 +50,7 @@ test:ubuntu_python: - !reference [.retrieve_deps:apt, script] script: - source venv/bin/activate - - python3 -m pip install unittest-xml-reporting + - python -m pip install unittest-xml-reporting - > if [[ "$CI_PROJECT_NAME" == "aidge_onnx" ]]; then python3 -m pip install requests @@ -59,7 +59,7 @@ test:ubuntu_python: # Run on discovery all tests located in project/unit_tests/python and discard the stdout # only to show the errors/warnings and the results of the tests - python -m pip list - - python3 -m xmlrunner discover -s unit_tests/ -v -b --output-file xmlrunner-results.xml + - python -m xmlrunner discover -s unit_tests/ -v -b --output-file xmlrunner-results.xml artifacts: reports: @@ -74,16 +74,19 @@ coverage:ubuntu_python: extends: .rules:static_analysis_coverage tags: - docker - script: + + before_script: + - apt-get update + - apt-get install -y python-is-python3 python3-pip cmake # cmake for aidge_core tests - source venv/bin/activate - - python3 -m pip install numpy coverage requests - - python3 -m pip list + - python -m pip install numpy coverage requests unittest-xml-reporting + script: - cd ${CI_PROJECT_NAME} # Retrieve the installation path of the module, since it is installed with pip. - export MODULE_LOCATION=`python -c "import ${CI_PROJECT_NAME} as _; print(_.__path__[0])"` - - python3 -m coverage run --source=$MODULE_LOCATION -m unittest discover -s unit_tests/ -v -b - - python3 -m coverage report - - python3 -m coverage xml + - python -m coverage run --source=$MODULE_LOCATION -m unittest discover -s unit_tests/ -v -b + - python -m coverage report + - python -m coverage xml coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: reports: