File: test.yml

package info (click to toggle)
pyzbar 0.1.9-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 284 kB
  • sloc: python: 889; sh: 20; makefile: 16
file content (73 lines) | stat: -rw-r--r-- 2,189 bytes parent folder | download | duplicates (2)
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 libzbar0 python-opencv

      - name: Install macOS dependencies
        if: runner.os == 'macOS'
        run: |
          brew update
          brew install zbar

      - 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 pyzbar
          curl --location --remote-name-all "https://github.com/NaturalHistoryMuseum/barcode-reader-dlls/releases/download/0.1/{libzbar-32.dll,libiconv-2.dll}"
          cd ..

      - name: Download 64-bit DLLs
        if: ${{ runner.os == 'Windows' && matrix.architecture == 'x64' }}
        run: |
          cd pyzbar
          curl --location --remote-name-all "https://github.com/NaturalHistoryMuseum/barcode-reader-dlls/releases/download/0.1/{libzbar-64.dll,libiconv.dll}"
          cd ..

      - name: Run tests
        run: pytest --verbose --cov=pyzbar pyzbar

      - 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 }}