-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable github ci actions pipeline (#11)
* enable github ci actions pipeline * install wordnet data
- Loading branch information
1 parent
e1d0641
commit ada1077
Showing
3 changed files
with
120 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build python package | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Checkout Code 🛎 | ||
uses: actions/checkout@v2 | ||
- name: Cache pip 👜 | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if setup.cfg has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.cfg') }} | ||
- name: Install package 🧊 | ||
run: pip install .[testing] | ||
- name: Run tests 📈 | ||
run: | | ||
python -m nltk.downloader wordnet | ||
python -m nltk.downloader omw | ||
pip install spacy~=2.0 | ||
python -m spacy download en_core_web_sm | ||
python -m spacy download es_core_news_sm | ||
pytest tests | ||
pip install spacy~=3.0.0 | ||
python -m spacy download en_core_web_sm | ||
python -m spacy download es_core_news_sm | ||
pytest tests | ||
- name: Build Package 🍟 | ||
run: | | ||
pip install -U build | ||
python -m build | ||
- name: Upload package artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-package | ||
path: dist | ||
|
||
# This job will upload a Python Package using Twine when a release is created | ||
# For more information see: | ||
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
deploy_release: | ||
name: Deploy Release | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'release' }} | ||
needs: | ||
- build | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Checkout Code 🛎 | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download python package | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: python-package | ||
path: dist | ||
- name: Publish Package to TestPyPI 🥪 | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Test Installing 🍿 | ||
run: pip install --index-url https://test.pypi.org/simple --no-deps spacy-wordnet==${GITHUB_REF#refs/*/v} | ||
- name: Publish Package to PyPI 🥩 | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters