forked from openslide/openslide
-
Notifications
You must be signed in to change notification settings - Fork 6
139 lines (114 loc) · 4.69 KB
/
python.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Python
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.cfg.os }}
name: ${{ matrix.cfg.os }}@${{ matrix.cfg.python-version }}
strategy:
matrix:
cfg:
- {os: ubuntu-latest, cc: gcc, cxx: g++, python-version: 3.6}
- {os: ubuntu-latest, cc: gcc, cxx: g++, python-version: 3.7}
- {os: ubuntu-latest, cc: gcc, cxx: g++, python-version: 3.8}
- {os: ubuntu-latest, cc: gcc, cxx: g++, python-version: 3.9}
#- {os: windows-latest, cc: cl, cxx: MSVC19.28.29333.0, python-version: 3.5}
#- {os: windows-latest, cc: cl, cxx: MSVC19.28.29333.0, python-version: 3.6}
#- {os: windows-latest, cc: cl, cxx: MSVC19.28.29333.0, python-version: 3.7}
#- {os: windows-latest, cc: cl, cxx: MSVC19.28.29333.0, python-version: 3.8}
#- {os: macOS-10.15, cc: xcode, cxx: xcode11.2.1, python-version: 3.5}
#- {os: macOS-10.15, cc: xcode, cxx: xcode11.2.1, python-version: 3.6}
#- {os: macOS-10.15, cc: xcode, cxx: xcode11.2.1, python-version: 3.7}
#- {os: macOS-10.15, cc: xcode, cxx: xcode11.2.1, python-version: 3.8}
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Set up Python ${{ matrix.cfg.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.cfg.python-version }}
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Install compiler and dependencies (Ubuntu)
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y ${{ matrix.cfg.cxx }}
echo "CC=${{ matrix.cfg.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cfg.cxx }}" >> $GITHUB_ENV
# Install the required Library
sudo apt install -y libtiff-dev
sudo apt install -y libglib2.0-dev
sudo apt install -y libcairo2-dev
sudo apt install -y libgdk-pixbuf2.0-dev
sudo apt install -y libopenjp2-7
sudo apt install -y libopencv-dev
sudo apt install -y libsqlite3-dev
sudo apt install -y libxml2-dev
sudo apt install -y zlib1g-dev
sudo apt install -y libpng-dev
sudo apt install -y libwebp-dev
sudo apt install -y libzstd-dev
# Install OpenJPEG library from source since bionic distribution doesn't support it
sudo apt install -y liblcms2-dev libz-dev
git clone https://github.com/uclouvain/openjpeg --depth 1
cd openjpeg
git fetch --unshallow
mkdir build && cd build
sudo cmake .. -DCMAKE_BUILD_TYPE=Release
sudo make install
cd .. && cd ..
- name: Install compiler and dependencies (macOS)
if: runner.os == 'macOS'
run: |
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci; source ./macports-ci install
sudo xcode-select -switch /Applications/Xcode_11.2.1.app
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
# Install the required Library
brew install libtiff
brew install glib
brew install cairo
brew install gdk-pixbuf
brew install jpeg
brew install openjpeg
brew install opencv
brew install sqlite
brew install libxml2
brew install zlib
brew install libpng
- name: Restore from cache and run vcpkg (Windows)
if: runner.os == 'Windows'
env:
vcpkgResponseFile: ${{ github.workspace }}/cmake/vcpkg_windows.diff
uses: lukka/run-vcpkg@v6
with:
vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '8121b4ec3d6a11353daf7639ed9082a78e617a2e'
appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install flake8 pytest
python3 -m pip install -r requirements.txt
- name: Install testing dependencies
run: |
python3 -m pip install codecov pytest-cov
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
python3 -m flake8 ./python --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# python3 -m flake8 ./python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install openslide
run: |
python3 setup.py develop --user