From e99ec6f516d98e808c7171ae76a248872c0a09bd Mon Sep 17 00:00:00 2001 From: Nitin Madnani Date: Thu, 18 Mar 2021 20:48:51 -0400 Subject: [PATCH 1/3] Replace .travis.yaml with .gitlab-ci.yaml. - Use an API token for codecov since Gitlab CI is not natively supported. --- .gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++++++ .travis.yml | 31 ------------------------------- 2 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 .gitlab-ci.yml delete mode 100644 .travis.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..64e65d2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,35 @@ +image: continuumio/miniconda3:latest + +stages: + - test + +variables: + PYVERSION: "3.8" + NOSE_WITH_COV: "1" + NOSE_COVER_PACKAGE: "factor_analyzer" + LOGCAPTURE_LEVEL: "DEBUG" + CODECOV_TOKEN: "034f0bb1-e590-406f-820c-4e7c41b17712" + +# set up the basic job +.runtests: + before_script: + - "conda create --prefix /root/factordev --channel conda-forge --file conda_requirements.txt python=${PYVERSION} codecov nose nose-cov --yes --quiet" + - /root/factordev/bin/pip install -e . + script: + - "/root/factordev/bin/nosetests ${TESTFILES}" + after_script: + - /root/factordev/bin/codecov + +# first set of test files +testset1: + extends: ".runtests" + variables: + TESTFILES: "tests/test_expected_confirmatory_factor_analyzer.py tests/test_factor_analyzer.py" + stage: "test" + +# second set of test files +testset2: + extends: ".runtests" + variables: + TESTFILES: "tests/test_expected_factor_analyzer.py tests/test_expected_rotator.py tests/test_utils.py" + stage: "test" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 174ef91..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: python -python: - - 3.7 -env: - - TESTFILES="tests/test_expected_confirmatory_factor_analyzer.py tests/test_factor_analyzer.py" - - TESTFILES="tests/test_expected_factor_analyzer.py tests/test_expected_rotator.py tests/test_utils.py" - -# run on the new Travis infrastructure -sudo: false - -# Install stuff -before_install: - - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda3/bin:$PATH - - conda install -c anaconda --yes setuptools -install: - - conda install --yes -c conda-forge python=${TRAVIS_PYTHON_VERSION} codecov --file requirements.txt - # Have to use pip for nose-cov because its entry points are not supported by conda yet - - pip install nose nose-cov - - python setup.py install - -# Run test -script: - - nosetests -v --with-cov --cov factor_analyzer --cov-config .coveragerc --logging-level=DEBUG ${TESTFILES} - -# Calculate coverage -after_success: - - codecov - From fd6343501e686c1ea629a091ca5d85242f277c46 Mon Sep 17 00:00:00 2001 From: Nitin Madnani Date: Thu, 18 Mar 2021 20:53:43 -0400 Subject: [PATCH 2/3] Fix typo. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64e65d2..d63e805 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ variables: # set up the basic job .runtests: before_script: - - "conda create --prefix /root/factordev --channel conda-forge --file conda_requirements.txt python=${PYVERSION} codecov nose nose-cov --yes --quiet" + - "conda create --prefix /root/factordev --channel conda-forge --file requirements.txt python=${PYVERSION} codecov nose nose-cov --yes --quiet" - /root/factordev/bin/pip install -e . script: - "/root/factordev/bin/nosetests ${TESTFILES}" From a2b831f54041d4a19f4e8fe3341ce04fc8bfff93 Mon Sep 17 00:00:00 2001 From: Nitin Madnani Date: Thu, 18 Mar 2021 21:02:35 -0400 Subject: [PATCH 3/3] Replace Travis CI badge with Gitlab CI --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index d320b4e..cb47d28 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,9 @@ FactorAnalyzer -------------- -.. image:: https://img.shields.io/travis/EducationalTestingService/factor_analyzer/main.svg +.. image:: https://gitlab.com/EducationalTestingService/factor_analyzer/badges/main/pipeline.svg :alt: Build status - :target: https://travis-ci.org/EducationalTestingService/factor_analyzer + :target: https://gitlab.com/EducationalTestingService/factor_analyzer/-/pipelines .. image:: https://codecov.io/gh/EducationalTestingService/factor_analyzer/branch/main/graph/badge.svg :target: https://codecov.io/gh/EducationalTestingService/factor_analyzer