diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 77% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 5b35140a0..6c007ec21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,18 @@ -name: ci +name: build -on: [pull_request] +on: + schedule: + - cron: '44 4 * * *' + pull_request: + branches: + - main + - develop + release: jobs: pretest: runs-on: ubuntu-latest strategy: - max-parallel: 4 matrix: toxenv: [flake8, pylint, doc8, docs] @@ -58,7 +64,6 @@ jobs: env_vars: PLATFORM,PYTHON name: codecov-umbrella fail_ci_if_error: false - verbose: true backward-compatibility: needs: pretest runs-on: ubuntu-latest @@ -90,11 +95,10 @@ jobs: uses: codecov/codecov-action@v1 with: file: ./coverage.xml - flags: unittests + flags: backward env_vars: PLATFORM,PYTHON name: codecov-umbrella fail_ci_if_error: false - verbose: true pypi: needs: [test, backward-compatibility] runs-on: ubuntu-latest @@ -108,16 +112,35 @@ jobs: run: | python -m pip install --upgrade pip pip install tox tox-gh-actions - - name: Test with tox + - name: Test packaging run: tox -e packaging + - name: Build + run: tox -e build + - name: Publish distribution đŸ“¦ to Test PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution đŸ“¦ to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} conda: needs: [test, backward-compatibility] runs-on: ubuntu-latest + env: + ANACONDA_TOKEN: ${{ secrets.anaconda_token }} steps: - uses: actions/checkout@v1 - name: Set up Python 3.7 uses: actions/setup-python@v2 with: python-version: 3.7 - - name: Conda build - run: ./conda/conda_test.sh + - name: Build conda + run: ./conda/ci_build.sh + - name: Publish distribution đŸ“¦ to Conda + if: startsWith(github.ref, 'refs/tags') + run: ./conda/upload.sh diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml deleted file mode 100644 index 9afa65329..000000000 --- a/.github/workflows/stable.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: build - -on: - schedule: - - cron: '44 4 * * *' - -jobs: - pretest: - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - toxenv: [flake8, pylint, doc8, docs] - - steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: tox -e ${{ matrix.toxenv }} - test: - needs: pretest - runs-on: ${{ matrix.platform }} - strategy: - max-parallel: 4 - matrix: - platform: [ubuntu-latest] - python-version: [3.6, 3.7, 3.8] - - steps: - - uses: actions/checkout@master - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Setup MongoDB - uses: supercharge/mongodb-github-action@1.3.0 - with: - mongodb-version: 4.2 - - name: Configure MongoDB - run: mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: | - tox -e py - tox -e final-coverage - tox -e codecov - env: - PLATFORM: ${{ matrix.platform }} - backward-compatibility: - needs: pretest - runs-on: ubuntu-latest - strategy: - max-parallel: 2 - matrix: - orion_db_type: [mongodb, pickleddb] - steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Setup MongoDB - uses: supercharge/mongodb-github-action@1.3.0 - with: - mongodb-version: 4.2 - - name: Configure MongoDB - run: mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: | - tox -e backward-compatibility - tox -e final-coverage - tox -e codecov - env: - ORION_DB_TYPE: ${{ matrix.orion_db_type }} - pypi: - needs: [test, backward-compatibility] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Test with tox - run: tox -e packaging - conda: - needs: [test, backward-compatibility] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Conda build - run: ./conda/conda_test.sh diff --git a/MANIFEST.in b/MANIFEST.in index 405fe6c53..50c58745d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,7 +11,6 @@ include src/orion/core/_version.py include versioneer.py # Exclude development helpers -exclude .travis.yml exclude tox.ini exclude *-requirements.txt exclude .pylintrc @@ -19,6 +18,7 @@ exclude .flake8 exclude codecov.yml exclude .mailmap prune conda/ +prune .github/ # Include src, tests, docs recursive-include docs *.rst *.py *.gitkeep *.png diff --git a/README.rst b/README.rst index 8ea07f26a..dda96438e 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ OrĂ­on ***** |pypi| |py_versions| |license| |doi| -|rtfd| |codecov| |travis| +|rtfd| |codecov| |github-actions| .. |pypi| image:: https://img.shields.io/pypi/v/orion.svg :target: https://pypi.python.org/pypi/orion @@ -29,8 +29,8 @@ OrĂ­on :target: https://codecov.io/gh/Epistimio/orion :alt: Codecov Report -.. |travis| image:: https://github.com/Epistimio/orion/workflows/build/badge.svg - :target: https://github.com/Epistimio/orion/actions?query=workflow:"build" +.. |github-actions| image:: https://github.com/Epistimio/orion/workflows/build/badge.svg?branch=master&event=pull_request + :target: https://github.com/Epistimio/orion/actions?query=workflow:build+branch:master+event:schedule :alt: Github actions tests OrĂ­on is an asynchronous framework for black-box function optimization. diff --git a/conda/conda_test.sh b/conda/ci_build.sh similarity index 65% rename from conda/conda_test.sh rename to conda/ci_build.sh index 8c0878af3..651a1ebf8 100755 --- a/conda/conda_test.sh +++ b/conda/ci_build.sh @@ -1,8 +1,5 @@ #!/bin/bash -set -e -set -x - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh -b -p $HOME/miniconda export PATH="$HOME/miniconda/bin:$PATH" @@ -21,11 +18,3 @@ conda install conda-build anaconda-client conda build conda --python 3.6 conda build conda --python 3.7 conda build conda --python 3.8 - -if [[ -n "${TRAVIS_TAG}" ]] -then - mkdir -p conda-bld/linux-64 - cp $HOME/miniconda/conda-bld/linux-64/orion* conda-bld/linux-64/ - conda convert --platform all conda-bld/linux-64/orion* --output-dir conda-bld/ - anaconda -t $ANACONDA_TOKEN upload conda-bld/**/orion* -fi diff --git a/conda/conda_build.sh b/conda/conda_build.sh deleted file mode 100755 index e750c118d..000000000 --- a/conda/conda_build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -./conda/conda_test.sh - -if [[ -n "${TRAVIS_TAG}" ]] -then - mkdir -p conda-bld/linux-64 - cp $HOME/miniconda/conda-bld/linux-64/orion* conda-bld/linux-64/ - conda convert --platform all conda-bld/linux-64/orion* --output-dir conda-bld/ - anaconda -t $ANACONDA_TOKEN upload conda-bld/**/orion* -fi diff --git a/conda/upload.sh b/conda/upload.sh new file mode 100755 index 000000000..15b43833b --- /dev/null +++ b/conda/upload.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +export PATH="$HOME/miniconda/bin:$PATH" + +mkdir -p conda-bld/linux-64 +cp $HOME/miniconda/conda-bld/linux-64/orion* conda-bld/linux-64/ +conda convert --platform all conda-bld/linux-64/orion* --output-dir conda-bld/ +anaconda -t $ANACONDA_TOKEN upload conda-bld/**/orion* diff --git a/docs/src/developer/ci.rst b/docs/src/developer/ci.rst index 1241d1048..e73d89b41 100644 --- a/docs/src/developer/ci.rst +++ b/docs/src/developer/ci.rst @@ -1,25 +1,29 @@ +.. _ci: + ********************** Continuous Integration ********************** -.. image:: https://travis-ci.org/epistimio/orion.svg?branch=master - :target: https://travis-ci.org/epistimio/orion +.. image:: https://github.com/Epistimio/orion/workflows/build/badge.svg?branch=master&event=pull_request + :target: https://github.com/Epistimio/orion/actions?query=workflow:build+branch:master+event:schedule + :alt: Github actions tests .. image:: https://codecov.io/gh/epistimio/orion/branch/master/graphs/badge.svg?branch=master :target: https://codecov.io/gh/epistimio/orion -We use travis-ci_ and codecov_ for continuous integration and tox_ to automate the process at +We use github-actions_ and codecov_ for continuous integration and tox_ to automate the process at the repository level. -When a commit is pushed in a pull request, a call to ``$ tox`` is made by -TravisCI which triggers the following chain of events: +When a commit is pushed in a pull request, a github workflow is spawned which +triggers the following chain of events: -#. A test environment is spun up for each version of python tested (defined in ``tox.ini``). #. Code styles verifications, and quality checks are run (``flake8``, ``pylint``, ``doc8``). The documentation is also built at this time (``docs``). +#. When code style verifications and documentation built passes, a test environment is spun up for + each version of python tested (defined in ``.github/workflows/build.yml``). #. The test suite is run completely with coverage, including the dedicated backward compatibility tests. -#. The structure of the repository is validated by ``check-manifest`` and ``readme_renderer``. -#. The results of the coverage check are reported directly in the pull request. +#. When all code tests passes, the structure of the repository is validated by ``check-manifest`` + and ``readme_renderer``, and packaging for PyPi and Conda is tested. The coverage results show the difference of coverage introduced by the changes. We always aim to have changes that improve coverage. @@ -28,6 +32,12 @@ If a step fails at any point in any environment, the build will be immediately s failed and reported to the pull request and repository. In such case, the maintainers and relevant contributors will be alerted. +The workflow described above is also executed daily to detect any break due to change in +dependencies. When releases are made, the workflow is also executed and additionally +publish the release to PyPi_ and Conda_. + .. _codecov: https://codecov.io/ -.. _travis-ci: https://travis-ci.com/ +.. _github-actions: https://docs.github.com/en/free-pro-team@latest/actions .. _tox: https://tox.readthedocs.io/en/latest/ +.. _PyPI: https://pypi.org/project/orion/ +.. _Conda: https://anaconda.org/epistimio/orion diff --git a/docs/src/developer/release.rst b/docs/src/developer/release.rst index bb8c77e7d..28fe06850 100644 --- a/docs/src/developer/release.rst +++ b/docs/src/developer/release.rst @@ -39,29 +39,23 @@ time to create the release artifacts and publish the release. release candidate pull request's for the description. See the `0.1.6 `_ version example. #. Merge the master branch back to develop. -#. Update the backward compability tests by adding the new version. #. Delete the release candidate branch. +#. Update the backward compability tests by adding the new version in develop branch + and make a pull request on develop. -Publishing the release -====================== -Once the release is correctly documented and integrated to the VCS workflow, we can publish it to -the public. - -* Publish the GitHub release. The source code archives will be added automatically by GitHub to the - release. -* Publish the new version to PyPI_ by executing ``$ tox -e release`` from the tagged commit on the - master branch. +Once the release is made, the :ref:`ci` will be automatically started by Github. The code will +then be published on PyPI_ and Anaconda_ automatically if the tests passes. After the release ================= -Once published, it's important to notify our user base and community that a new version exists so -they can update their version or learn about OrĂ­on. +Once published, it's important to notify our user base and community that a new +version exists so they can update their version or learn about OrĂ­on. * Verify OrĂ­on's Zenodo_ page has been updated to reflect the new release on GitHub_. Zenodo is configured to automatically create a new version whenever a new release is published on GitHub. -* Verify OrĂ­on's Anaconda_ page contains the new version. Binaries for the new version are uploaded - automatically by TravisCI when the tests pass for the merge commit tagged with the new version on - the master branch . +* Verify OrĂ­on's PyPI_ and Anaconda_ page contains the new version. Binaries for the new version are + uploaded automatically by Github's workflow when the tests pass for the merge commit tagged with + the new version on the master branch . * Announce the new release on your #orion's slack channel. * Announce the new release on relevant communication channels (e.g., email, forums, google groups) * Congratulations, you published a new version of OrĂ­on! diff --git a/tests/functional/gradient_descent_algo/MANIFEST.in b/tests/functional/gradient_descent_algo/MANIFEST.in index 459c1376a..022fd2080 100644 --- a/tests/functional/gradient_descent_algo/MANIFEST.in +++ b/tests/functional/gradient_descent_algo/MANIFEST.in @@ -8,7 +8,6 @@ include src/orion/core/_version.py include versioneer.py # Exclude development helpers -exclude .travis.yml exclude tox.ini exclude *-requirements.txt exclude .pylintrc