Skip to content

troubleshooting zbar issue #9

troubleshooting zbar issue

troubleshooting zbar issue #9

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# https://jacobian.org/til/github-actions-poetry/
# https://github.com/snok/install-poetry
# https://python-poetry.org/docs/pyproject/#extras
# https://github.com/awalsh128/cache-apt-pkgs-action
name: Upload MFAwesome to Test-Pypi
on:
push:
branches:
- dev
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
environment:
name: pypi
url: https://test.pypi.org/project/mfawesome/
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel build
- name: Build package
run: python3 -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
runtests:
environment:
name: pypi
url: https://test.pypi.org/project/mfawesome/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-1.8.4-0
- uses: snok/install-poetry@v1
with:
version: 1.4.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: Install Apt dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: apt-utils libgl1 libzbar0 libzbar-dev zbar-tools python3-pyzbar python3-zbar
version: 1.0
- run: poetry install --no-interaction --no-root --all-extras
- name: Run Tests with Poetry
run: |
apt list | grep -i zbar
poetry run python -c "from qreader import QReader; qr = QReader()"
poetry run pytest -v
poetry run coverage run
poetry run coverage report
poetry run coverage xml
##disabledif: steps.cache-deps.outputs.cache-hit != 'true'