-
Notifications
You must be signed in to change notification settings - Fork 56
73 lines (61 loc) · 2.12 KB
/
test.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
name: Tests
on: [push]
jobs:
build:
strategy:
matrix:
os: [ubuntu-18.04]
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, 3.10.0]
include:
- os: macos-10.15
python-version: 3.10.0
- os: windows-2019
python-version: 3.10.0
architecture: 'x86'
- os: windows-2019
python-version: 3.10.0
architecture: 'x64'
runs-on: ${{ matrix.os }}
steps:
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libdmtx0a python-opencv
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew update
brew install libdmtx
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip==20.3.4
pip install -r requirements-test.txt
- name: Download 32-bit DLLs
if: ${{ runner.os == 'Windows' && matrix.architecture == 'x86' }}
run: |
cd pylibdmtx
curl --location --remote-name-all "https://github.com/NaturalHistoryMuseum/barcode-reader-dlls/releases/download/0.1/libdmtx-32.dll"
cd ..
- name: Download 64-bit DLLs
if: ${{ runner.os == 'Windows' && matrix.architecture == 'x64' }}
run: |
cd pylibdmtx
curl --location --remote-name-all "https://github.com/NaturalHistoryMuseum/barcode-reader-dlls/releases/download/0.1/libdmtx-64.dll"
cd ..
- name: Run tests
run: pytest --verbose --cov=pylibdmtx pylibdmtx
- name: Upload coverage
if: ${{ matrix.python-version == '3.10.0' && runner.os == 'Linux' }}
run: |
pip install coveralls>=3.2.0
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}