-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] Refactoring build process with Poetry and changing CI to Githu…
…b Actions (#38) * feat: rm travis and using poetry * ci: fix lintings * ci: fix linting path * ci: change poetry steps and 3.10 version * ci: fix cache * ci: rm venv activate * feat: supporting only 3.8 and above * feat: dep 3.10 and above * ci: activating poetry env * docs: update readme * ci: rm poetry use env * ci: publish on release * docs: update badges
- Loading branch information
Showing
20 changed files
with
1,846 additions
and
493 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,31 @@ | ||
name: Publish | ||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
publish: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.9] | ||
poetry-version: [1.1.2] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install and set up Poetry | ||
run: | | ||
python get-poetry.py --preview -y | ||
source $HOME/.poetry/env | ||
poetry config virtualenvs.in-project true | ||
- name: Publish on PyPi | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --build |
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,176 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
Linting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
- name: Linting | ||
uses: psf/black@stable | ||
with: | ||
options: "--check --verbose" | ||
src: "./spacy_lefff ./tests" | ||
version: "22.6" | ||
Linux: | ||
needs: Linting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, '3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
- name: Test | ||
run: | | ||
poetry run spacy download fr_core_news_sm | ||
poetry run pytest --cov=. --cov-report=xml | ||
#---------------------------------------------- | ||
# upload coverage stats | ||
# (requires CODECOV_TOKEN in repository secrets) | ||
#---------------------------------------------- | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} # Only required for private repositories | ||
file: ./coverage.xml | ||
fail_ci_if_error: true | ||
MacOS: | ||
needs: Linting | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, '3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
- name: Test | ||
run: | | ||
poetry run spacy download fr_core_news_sm | ||
poetry run pytest --cov=. --cov-report=xml | ||
#---------------------------------------------- | ||
# upload coverage stats | ||
# (requires CODECOV_TOKEN in repository secrets) | ||
#---------------------------------------------- | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} # Only required for private repositories | ||
file: ./coverage.xml | ||
fail_ci_if_error: true | ||
Windows: | ||
needs: Linting | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, '3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
- name: Test | ||
run: | | ||
poetry run spacy download fr_core_news_sm | ||
poetry run pytest --cov=. --cov-report=xml | ||
#---------------------------------------------- | ||
# upload coverage stats | ||
# (requires CODECOV_TOKEN in repository secrets) | ||
#---------------------------------------------- | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} # Only required for private repositories | ||
file: ./coverage.xml | ||
fail_ci_if_error: true |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.