Simplify code remove duplication #46
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libfuse-dev | |
python -m pip install --upgrade pip | |
pip install coverage | |
pip install -e . | |
- name: Run tests with coverage | |
run: | | |
coverage run -m unittest discover -s tests | |
coverage xml # Generates the XML report for Codacy | |
- name: Upload coverage to Codacy | |
run: | | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Python -r coverage.xml | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} |