| 1 |
name: Python package |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: ["master"] |
| 6 |
pull_request: |
| 7 |
branches: ["master"] |
| 8 |
|
| 9 |
jobs: |
| 10 |
build: |
| 11 |
runs-on: ubuntu-latest |
| 12 |
strategy: |
| 13 |
fail-fast: false |
| 14 |
matrix: |
| 15 |
python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v4 |
| 18 |
- name: Set up Python ${{ matrix.python-version }} |
| 19 |
uses: actions/setup-python@v3 |
| 20 |
with: |
| 21 |
python-version: ${{ matrix.python-version }} |
| 22 |
- name: Install dependencies |
| 23 |
run: | |
| 24 |
sudo apt install -y ledger hledger |
| 25 |
python -m pip install --upgrade pip |
| 26 |
python -m pip install --upgrade poetry |
| 27 |
python -m pip install flake8 pytest |
| 28 |
poetry install --with=dev |
| 29 |
- name: Lint with black |
| 30 |
run: | |
| 31 |
poetry run black --check . |
| 32 |
- name: Test with pytest |
| 33 |
run: | |
| 34 |
poetry run python -m pytest |