Skip to content

Commit

Permalink
workflow updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NHagar committed Apr 4, 2024
1 parent 551e3cb commit 9f0f0b0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 63 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on: pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Add Poetry to path
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install venv
run: poetry install
- name: Test
run: poetry run pytest
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish to PyPI
on:
release:
types: [published]

jobs:
pypi_release:
name: Builds Using Poetry and Publishes to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- 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
- run: poetry install
- run: poetry run pytest
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
- name: Publish package
run: poetry publish --build
4 changes: 3 additions & 1 deletion tests/test_newsletter.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def test_get_newsletter_recommendations(
)

mock_get.assert_called_once_with(
"https://test_subdomain.substack.com/recommendations", headers=HEADERS
"https://test_subdomain.substack.com/recommendations",
headers=HEADERS,
timeout=30,
)
mock_bs_init.assert_called_once_with("mocked_html", "html.parser")
self.assertEqual(mock_find_all.call_count, 2)
Expand Down

0 comments on commit 9f0f0b0

Please sign in to comment.