Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ jobs:
include:
- os: windows-latest
TARGET: windows
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F truth_seeker.py
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F ./app/truth_seeker.py
OUT_FILE_NAME: truth_seeker.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
- os: ubuntu-latest
TARGET: ubuntu
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F truth_seeker.py
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F ./app/truth_seeker.py
OUT_FILE_NAME: truth_seeker
ASSET_MIME: application/x-binary

Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions">ActionsList</a>

Commit with tag: ${{ needs.prepare.outputs.CURRENT_TAG }}
Commit with tag: ${{ env.CURRENT_TAG }}

Repository: ${{ github.repository }}

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,32 @@ jobs:
<b>!!! FAILED !!!</b>
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }}

pytesting:
runs-on: ubuntu-latest
name: Testing with pytest
container: python:3.9
needs: [ code_quality ]

steps:

- name: Checkout code
uses: actions/checkout@v2

- name: Run script
run: pip install -r requirements.txt

- name: Testing
run: pytest -v ./tests/

- name: Notify if failure
if: ${{ failure() }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
message: |
<b>!!! FAILED !!!</b>
<b>Failed job:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ jobs:
include:
- os: windows-latest
TARGET: windows
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F truth_seeker.py
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F ./app/truth_seeker.py
OUT_FILE_NAME: truth_seeker.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
- os: ubuntu-latest
TARGET: ubuntu
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F truth_seeker.py
CMD_BUILD: python -m PyInstaller --clean --workpath /tmp/build --specpath /tmp -F ./app/truth_seeker.py
OUT_FILE_NAME: truth_seeker
ASSET_MIME: application/x-binary

Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.RELEASE_URL }}
upload_url: ${{ env.RELEASE_URL }}
asset_path: ./dist/${{ matrix.OUT_FILE_NAME }}
asset_name: ${{ matrix.OUT_FILE_NAME }}
asset_content_type: ${{ matrix.ASSET_MIME }}
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
black
isort
pyinstaller
pytest~=7.1.3
dynaconfig~=0.4
dynaconf~=3.1.11
newsapi-python~=0.2.6
newsapi-python~=0.2.6
Empty file added tests/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions tests/test_truth_seeker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from app import truth_seeker


def test_fetch_info():
"""
Simple test for fetching func
:return:
"""
return isinstance(truth_seeker.fetch_info("test"), dict)


def test_fetch_info_empty():
"""
Empty query
:return:
"""
return isinstance(truth_seeker.fetch_info(""), dict)