Merge pull request #11 from michael2to3/snyk-fix-8327cbaf300ec202c121… #107
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 Test | |
on: [push, pull_request_target] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Grant write permissions to test directory | |
run: | | |
mkdir db | |
chmod -R +w ./db | |
- name: Install dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
python -m pip install coverage | |
- name: Run unit tests | |
run: | | |
coverage run -m unittest discover -s ./test/ | |
coverage xml | |
- name: Upload coverage reports to Codacy | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml |