Skip to content

Merge pull request #41 from SaurabhJamadagni/355-template-update #9

Merge pull request #41 from SaurabhJamadagni/355-template-update

Merge pull request #41 from SaurabhJamadagni/355-template-update #9

name: Python Package CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install PyICU dependencies
run: |
brew bundle install --file=Brewfile
# configure PATH & PKG_CONFIG_PATH as per
# https://gitlab.pyicu.org/main/pyicu#installing-pyicu
echo "/usr/local/opt/icu4c/bin:/usr/local/opt/icu4c/sbin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" >> $GITHUB_ENV
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pylint pytest pytest-cov
if [ -f requirements.txt ]; then python3 -m pip install -r requirements.txt; fi
- name: Lint with pylint
run: |
# only report linting, do not fail ci run
pylint $(git ls-files '*.py') --exit-zero
- name: Test with pytest
run: |
pytest
- name: Test coverage with pytest-cov
run: |
pytest --cov=src