refactor(#106): use textractor to simplify code #98
Workflow file for this run
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
name: Python tests | |
on: | |
push: | |
paths: | |
- 'infra/api/**.py' | |
jobs: | |
unittest: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # ratchet:actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a # ratchet:actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # ratchet:actions/cache@v2 | |
name: Configure pip caching | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -r infra/api/requirements.txt | |
- name: test functions | |
run: | | |
coverage run -m pytest infra/api/test_extract.py infra/api/test_notify.py &&\ | |
coverage report -m | |
- name: Coverage Badge | |
uses: tj-actions/coverage-badge-py@c3a0870495183a1848c89d568db7a4e7954fee71 # ratchet:tj-actions/[email protected] | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@c09bcad97929b17bacf737670bee312af98be94f # ratchet:tj-actions/verify-changed-files@v9 | |
id: changed_files | |
with: | |
files: coverage.svg | |
- name: Commit files | |
if: steps.changed_files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add coverage.svg | |
git commit -m "Updated coverage.svg" | |
- name: Push changes | |
if: steps.changed_files.outputs.files_changed == 'true' | |
uses: ad-m/github-push-action@552c074ed701137ebd2bf098e70c394ca293e87f # ratchet:ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
branch: ${{ github.ref_name }} |