Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

[BBS-291] Migrate to GitHub Actions #258

Merged
merged 27 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1332980
remove .travis.yml + add first version of .github/workflows
FrancescoCasalegno Feb 23, 2021
b0f7bf0
remove jenkins
FrancescoCasalegno Feb 23, 2021
0b4b18c
fix indent
FrancescoCasalegno Feb 23, 2021
e91e41c
restore no-local-version
FrancescoCasalegno Feb 24, 2021
ebf33bb
add setuptools_scm to pypi workflow
FrancescoCasalegno Feb 24, 2021
976b4a9
fail-fast FAlse
FrancescoCasalegno Feb 24, 2021
2ea167f
add py39
FrancescoCasalegno Feb 24, 2021
1f4e27b
lint, docs, package only for 3.7
FrancescoCasalegno Feb 24, 2021
8d9d92b
if statements without dollar
FrancescoCasalegno Feb 24, 2021
2a441fa
update contributing, readme, and templates
FrancescoCasalegno Feb 24, 2021
6a65165
test publish pypi
FrancescoCasalegno Feb 24, 2021
203231b
version seems wrong..
FrancescoCasalegno Feb 24, 2021
c831d86
fetch unshallow?
FrancescoCasalegno Feb 24, 2021
818d5bc
fix indent
FrancescoCasalegno Feb 24, 2021
0863676
setup.py with extra info for pypi
FrancescoCasalegno Feb 24, 2021
85789b4
restore correct trigger for publish-pypi
FrancescoCasalegno Feb 24, 2021
1650107
Merge branch 'master' into bbs_291
FrancescoCasalegno Feb 24, 2021
a7bf99d
fix setup.py
FrancescoCasalegno Feb 24, 2021
2d24ed6
cancel workflow
FrancescoCasalegno Feb 24, 2021
7e576fd
access token
FrancescoCasalegno Feb 24, 2021
159196b
fix typo
FrancescoCasalegno Feb 24, 2021
6f5cf17
colorful tox
FrancescoCasalegno Feb 24, 2021
7ec4748
test pypi
FrancescoCasalegno Feb 24, 2021
fc485f5
Revert "test pypi"
FrancescoCasalegno Feb 24, 2021
ff77a07
remove img processing tag
FrancescoCasalegno Feb 25, 2021
e52753a
fix -- --color=yes
FrancescoCasalegno Feb 25, 2021
41c1a71
Merge branch 'master' into bbs_291
FrancescoCasalegno Feb 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Fixes #{issue-id-number}.
- [ ] Documentation and `whatsnew.rst` updated (if needed).
- [ ] `setup.py` and `requirements.txt` updated with new dependencies.
- [ ] Type annotations added (if a function is added or modified).
- [ ] Travis CI pipeline run (add `[test travis]` to your git commit to run it)
- [ ] All CI tests pass.
55 changes: 55 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: pypi publishing


on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'


jobs:

publish_on_pypi:

if: startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest

steps:

- name: checkout latest commit
uses: actions/checkout@v2

- name: get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
git describe --tags
git describe --tags $(git rev-list --tags --max-count=1)

- name: setup python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install setuptools_scm

- name: create source distribution
run: |
python setup.py sdist

- name: create wheel distribution
run: |
python setup.py bdist_wheel

- name: publish package to pypi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
65 changes: 65 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: ci testing


on:
push:
branches: master
pull_request:


jobs:

run_test:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [
3.7,
3.8,
3.9,
]
include:
- python-version: 3.7
tox-env: py37
- python-version: 3.8
tox-env: py38
- python-version: 3.9
tox-env: py39

steps:

- name: cancel previous workflows that are still running
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}

- name: checkout latest commit
uses: actions/checkout@v2

- name: setup python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install tox

- name: linting and code style
if: matrix.python-version == '3.7'
run: tox -vv -e lint

- name: tests and coverage
run: tox -vv -e ${{ matrix.tox-env }} -- --color=yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is matrix.tox-env able to find the tox-env values nested inside matrix.include.[*].tox-env?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I also tried with ${{ matrix.tox-env}} but it failed—here it should be w/o brackets.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tried with ${{ matrix.tox-env }} but it failed

Is there a typo? Because this is what is in the file.


- name: docs
if: matrix.python-version == '3.7'
run: tox -vv -e docs

- name: check packaging
if: matrix.python-version == '3.7'
run: tox -vv -e check-packaging
63 changes: 0 additions & 63 deletions .jenkins.sh

This file was deleted.

70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ to read the following guidelines.
1. [Add type annotations](#Ata)
1. [Update dependencies](#Udep)
1. [Update documentation](#Udoc)
1. [Trigger Travis CI](#Ttc)
1. [Ensure all CI tests pass](#Ttc)
1. [Get reviews and approval](#Ac)

## <a name="CreatingIssues"></a> Creating Issues
Expand Down Expand Up @@ -99,11 +99,16 @@ so you should update it if your PR adds or changes a feature, fixes a bug, etc.
Moreover, instructions and examples in the docs should be updated whenever
deemed appropriate.

### <a name="Ttc"></a> Trigger Travis CI
To save time, by default our Travis CI pipeline does not test commits on PR
branches unless the commit message contains a `[test travis]` or `[run travis]`
tag. So make sure to add such tag to your last commit (or add an empty commit
with such tag) before requesting a review of your PR.
### <a name="Ttc"></a> Ensure all CI tests pass
We use GitHub Actions to run [our CI tests](https://github.com/BlueBrain/Search/actions?query=workflow%3A%22ci+testing%22).
Once you open a PR, the workflow that runs all CI tests is automatically
triggered. This workflow is also triggered every time a new commit is pushed to
that PR branch. If you want to push a commit without triggering the CI tests
(e.g. if a feature is still work in progress and you want to save time), your
commit message should include an appropriate label like `[skip ci]`, `[ci skip]`,
`[no ci]` etc. (see
[here](https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/)
for the complete list).

All CI tests must pass before the pull request can be considered for review.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<tr>
<td>Build Status</td>
<td>
<a href="https://travis-ci.com/BlueBrain/Search">
<img src="https://travis-ci.com/BlueBrain/Search.svg?token=DiSGfujs1Bszyq2UxayG&branch=master" alt="Build status" />
<a href="https://github.com/BlueBrain/Search/actions?query=workflow%3A%22ci+testing%22+branch%3Amaster">
<img src="https://img.shields.io/github/workflow/status/BlueBrain/Search/ci%20testing/master" alt="Build status" />
</a>
</td>
</tr>
Expand Down
44 changes: 37 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,35 @@

from setuptools import find_packages, setup

install_requires = [
DESCRIPTION = (
"Blue Brain text mining toolbox for semantic search and information extraction"
)

LONG_DESCRIPTION = """
Blue Brain Search is a text mining toolbox to perform semantic literature search
and structured information extraction from text sources.

This project originated from the Blue Brain Project efforts on exploring and
mining the CORD-19 dataset."""

CLASSIFIERS = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: General",
]

PYTHON_REQUIRES = ">=3.7"

INSTALL_REQUIRES = [
"Flask",
"SQLAlchemy",
"dvc[ssh]",
Expand Down Expand Up @@ -47,7 +75,7 @@
"pyarrow",
]

extras_require = {
EXTRAS_REQUIRE = {
"dev": [
"cryptography",
"docker",
Expand All @@ -66,7 +94,8 @@

setup(
name="bluesearch",
description="Blue Brain Search",
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author="Blue Brain Project, EPFL",
url="https://github.com/BlueBrain/Search",
project_urls={
Expand All @@ -75,18 +104,19 @@
"Tracker": "https://bbpteam.epfl.ch/project/issues/projects/BBS",
},
license="-",
classifiers=CLASSIFIERS,
use_scm_version={
"write_to": "src/bluesearch/version.py",
"write_to_template": '"""The package version."""\n__version__ = "{version}"\n',
# "local_scheme": "no-local-version",
"local_scheme": "no-local-version",
},
package_dir={"": "src"},
packages=find_packages("./src"),
package_data={"bluesearch": ["_css/stylesheet.css", "py.typed"]},
zip_safe=False,
python_requires=">=3.7",
install_requires=install_requires,
extras_require=extras_require,
python_requires=PYTHON_REQUIRES,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
entry_points={
"console_scripts": [
"compute_embeddings = bluesearch.entrypoint:run_compute_embeddings",
Expand Down