Merge pull request #2 from Marley-Mulvin-Broome/json #25
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: Test and Lint | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "src/**" | |
- "test/**" | |
- "dev_requirements.txt" | |
- ".github/workflows/test.yaml" | |
pull_request: | |
paths: | |
- "src/**" | |
- "test/**" | |
- "dev_requirements.txt" | |
- ".github/workflows/test.yaml" | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff pytest | |
# stop the build if there are no dev_requirements.txt | |
test -f dev_requirements.txt || { echo "No dev_requirements.txt found" ; exit 1; } | |
pip install -r dev_requirements.txt | |
python3 -m unidic download | |
- name: Lint with ruff | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
ruff --format=github --select=E9,F63,F7,F82 --target-version=py310 src/jpfreq/*.py | |
- name: Test with pytest | |
run: | | |
pytest -n auto --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src/jpfreq --cov-fail-under=95 tests/ |