From 56dc2f65aceac7460d41011292d6a867ab1d2305 Mon Sep 17 00:00:00 2001 From: Remy Prechelt <prechelt@hawaii.edu> Date: Thu, 1 Oct 2020 21:45:34 -1000 Subject: [PATCH] Add initial Python CI setup. --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++ Python/README.md | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c8015fac0..893a544f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ stages: - build - test - build_test + - python - example - build_test_example - install @@ -616,3 +617,36 @@ sanity: untracked: true policy: pull key: "${CI_COMMIT_REF_SLUG}-gcc" + + + +########################################################## +# template for all Python jobs +.python: + stage: python + tags: + - corsika + script: + - cd ${CI_PROJECT_DIR}/Python # change into the Python directory + - pip install --user -e '.[test]' # install the package + test deps + - make all 2&>1 | tee python-test.log # this runs all of the Python tests + - cd ${CI_PROJECT_DIR} # reset the directory + artifacts: + when: always + expire_in: 1 year + paths: + - ${CI_PROJECT_DIR}/Python/python-test.log + +# we now configure the jobs for the three +# supported Python versions +python-3.6: + extends: .python + image: python:3.6 + +python-3.7: + extends: .python + image: python:3.7 + +python-3.8: + extends: .python + image: python:3.8 diff --git a/Python/README.md b/Python/README.md index d18222735..13c3143e8 100644 --- a/Python/README.md +++ b/Python/README.md @@ -25,7 +25,7 @@ If you wish to develop new features in `corsika`, you will also need to install some additional dependencies so you can run our unit tests. These can be installed with - pip install --user -e .[test] + pip install --user -e '.[test]' Once that is completed, you can run the unit tests directory from the `corsika` directory -- GitLab