| 1 |
name: Tests |
| 2 |
|
| 3 |
on: [push] |
| 4 |
|
| 5 |
jobs: |
| 6 |
build: |
| 7 |
strategy: |
| 8 |
matrix: |
| 9 |
os: [ubuntu-18.04] |
| 10 |
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, 3.10.0] |
| 11 |
include: |
| 12 |
- os: macos-10.15 |
| 13 |
python-version: 3.10.0 |
| 14 |
- os: windows-2019 |
| 15 |
python-version: 3.10.0 |
| 16 |
architecture: 'x86' |
| 17 |
- os: windows-2019 |
| 18 |
python-version: 3.10.0 |
| 19 |
architecture: 'x64' |
| 20 |
|
| 21 |
runs-on: ${{ matrix.os }} |
| 22 |
|
| 23 |
steps: |
| 24 |
- name: Install Linux dependencies |
| 25 |
if: runner.os == 'Linux' |
| 26 |
run: | |
| 27 |
sudo apt-get update |
| 28 |
sudo apt-get install -y libdmtx0a python-opencv |
| 29 |
|
| 30 |
- name: Install macOS dependencies |
| 31 |
if: runner.os == 'macOS' |
| 32 |
run: | |
| 33 |
brew update |
| 34 |
brew install libdmtx |
| 35 |
|
| 36 |
- name: Checkout |
| 37 |
uses: actions/checkout@v2 |
| 38 |
|
| 39 |
- name: Set up Python ${{ matrix.python-version }} |
| 40 |
uses: actions/setup-python@v2 |
| 41 |
with: |
| 42 |
python-version: ${{ matrix.python-version }} |
| 43 |
architecture: ${{ matrix.architecture }} |
| 44 |
|
| 45 |
- name: Install dependencies |
| 46 |
run: | |
| 47 |
python -m pip install --upgrade pip==20.3.4 |
| 48 |
pip install -r requirements-test.txt |
| 49 |
|
| 50 |
- name: Download 32-bit DLLs |
| 51 |
if: ${{ runner.os == 'Windows' && matrix.architecture == 'x86' }} |
| 52 |
run: | |
| 53 |
cd pylibdmtx |
| 54 |
curl --location --remote-name-all "https://github.com/NaturalHistoryMuseum/barcode-reader-dlls/releases/download/0.1/libdmtx-32.dll" |
| 55 |
cd .. |
| 56 |
|
| 57 |
- name: Download 64-bit DLLs |
| 58 |
if: ${{ runner.os == 'Windows' && matrix.architecture == 'x64' }} |
| 59 |
run: | |
| 60 |
cd pylibdmtx |
| 61 |
curl --location --remote-name-all "https://github.com/NaturalHistoryMuseum/barcode-reader-dlls/releases/download/0.1/libdmtx-64.dll" |
| 62 |
cd .. |
| 63 |
|
| 64 |
- name: Run tests |
| 65 |
run: pytest --verbose --cov=pylibdmtx pylibdmtx |
| 66 |
|
| 67 |
- name: Upload coverage |
| 68 |
if: ${{ matrix.python-version == '3.10.0' && runner.os == 'Linux' }} |
| 69 |
run: | |
| 70 |
pip install coveralls>=3.2.0 |
| 71 |
coveralls --service=github |
| 72 |
env: |
| 73 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |