-
Notifications
You must be signed in to change notification settings - Fork 69
48 lines (44 loc) · 1.49 KB
/
python_package_ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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