Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed Aug 25, 2023
1 parent 3e6ecaf commit 80a0015
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish package to PyPI
on:
push:
tags:
- '*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Poetry
run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
- name: Add Poetry to path
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry install --with dev,docs
poetry run python -m spacy download en_core_web_sm
- run: poetry config pypi-token.pypi "${{ secrets.PYPI }}"
- name: Publish package
run: poetry publish --build
17 changes: 9 additions & 8 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,29 @@ permissions:
contents: read

jobs:
build:

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Poetry
run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
- name: Add Poetry to path
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m spacy download en_core_web_sm
poetry install --with dev,docs
poetry run python -m spacy download en_core_web_sm
- name: Lint with Ruff
run: |
ruff --format=github --target-version=py310 --ignore E501 biaslyze/
poetry run ruff --format=github --target-version=py310 --ignore E501 biaslyze/
continue-on-error: true
- name: Test with pytest
run: |
pytest --cov=biaslyze tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
poetry run pytest --cov=biaslyze tests/ --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ install:
poetry install --with dev,docs
poetry run python -m spacy download en_core_web_sm

export:
poetry export -f requirements.txt --output requirements.txt --with dev --without-hashes

jupyter:
poetry run jupyter lab

Expand Down

0 comments on commit 80a0015

Please sign in to comment.