Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Android Build

on:
push:
pull_request:

jobs:
android-build:
runs-on: ubuntu-latest
name: Android Build

steps:
- uses: actions/checkout@v4

- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker build --tag=zbarcam-android \
--file=dockerfiles/Dockerfile-android .
- name: Build Android app
run: |
docker run --env-file dockerfiles/env.list \
zbarcam-android buildozer android debug
timeout-minutes: 30
38 changes: 38 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Linux Build

on:
push:
pull_request:

jobs:
linux-build:
runs-on: ubuntu-latest
name: Linux Build

steps:
- uses: actions/checkout@v4

- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker build --tag=zbarcam-linux \
--file=dockerfiles/Dockerfile-linux .
- name: Setup virtual frame buffer
run: |
sudo apt-get update
sudo apt-get install -y xvfb
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --env-file dockerfiles/env.list \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
zbarcam-linux make test
timeout-minutes: 30
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SYSTEM_DEPENDENCIES= \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libpython3.7-dev \
libpython$(PYTHON_VERSION)-dev \
libpython$(PYTHON_VERSION)-dev \
libzbar-dev \
pkg-config \
Expand All @@ -31,7 +31,7 @@ SYSTEM_DEPENDENCIES= \
virtualenv
OS=$(shell lsb_release -si 2>/dev/null || uname)
PYTHON_MAJOR_VERSION=3
PYTHON_MINOR_VERSION=7
PYTHON_MINOR_VERSION=12
PYTHON_VERSION=$(PYTHON_MAJOR_VERSION).$(PYTHON_MINOR_VERSION)
PYTHON_MAJOR_MINOR=$(PYTHON_MAJOR_VERSION)$(PYTHON_MINOR_VERSION)
PYTHON_WITH_VERSION=python$(PYTHON_VERSION)
Expand All @@ -46,7 +46,7 @@ endif

$(VIRTUAL_ENV):
$(PYTHON_WITH_VERSION) -m venv $(VIRTUAL_ENV)
$(PIP) install Cython==0.28.6
$(PIP) install Cython==0.29.15
$(PIP) install -r requirements.txt

virtualenv: $(VIRTUAL_ENV)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# zbarcam

[![Build Status](https://travis-ci.org/kivy-garden/zbarcam.svg?branch=develop)](https://travis-ci.org/kivy-garden/zbarcam)
[![Android Build](https://github.com/kivy-garden/zbarcam/actions/workflows/android-build.yml/badge.svg)](https://github.com/kivy-garden/zbarcam/actions/workflows/android-build.yml)
[![Linux Build](https://github.com/kivy-garden/zbarcam/actions/workflows/linux-build.yml/badge.svg)](https://github.com/kivy-garden/zbarcam/actions/workflows/linux-build.yml)
[![Coverage Status](https://coveralls.io/repos/github/kivy-garden/zbarcam/badge.svg?branch=develop)](https://coveralls.io/github/kivy-garden/zbarcam?branch=develop)
[![PyPI version](https://badge.fury.io/py/zbarcam.svg)](https://badge.fury.io/py/zbarcam)
[![Documentation Status](https://readthedocs.org/projects/zbarcam/badge/?version=latest)](https://zbarcam.readthedocs.io/en/latest/?badge=latest)
Expand Down
14 changes: 7 additions & 7 deletions buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ version.filename = %(source.dir)s/kivy_garden/zbarcam/version.py
# comma seperated e.g. requirements = sqlite3,kivy
requirements =
android,
hostpython3==3.8.1,
Kivy==58e70b1,
hostpython3==3.10.12,
Kivy==2.3.1,
libiconv,
libzbar,
Pillow==7.0.0,
python3==3.8.1,
Pillow==8.4.0,
python3==3.10.12,
pyzbar==0.1.8,
xcamera==2019.928
Expand Down Expand Up @@ -78,7 +78,7 @@ orientation = portrait
osx.python_version = 3
# Kivy version to use
osx.kivy_version = 1.9.1
osx.kivy_version = 2.3.1
#
# Android specific
Expand Down Expand Up @@ -107,7 +107,7 @@ android.minapi = 21
android.sdk = 20
# (str) Android NDK version to use
android.ndk = 19b
android.ndk = 25b
# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
android.ndk_api = 21
Expand Down Expand Up @@ -219,7 +219,7 @@ android.arch = armeabi-v7a
#p4a.fork = kivy
# (str) python-for-android branch to use, defaults to master
p4a.branch = v2020.04.29
p4a.branch = v2024.01.21
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
Expand Down
21 changes: 14 additions & 7 deletions dockerfiles/Dockerfile-android
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
# docker run zbarcam-android 'buildozer android debug'
# Or for interactive shell:
# docker run -it --rm zbarcam-android
FROM ubuntu:18.04
FROM ubuntu:24.04

ARG CI=false
ARG PYTHON_VERSION=3.12
ARG JAVA_VERSION=17
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}" \
Expand All @@ -35,16 +37,16 @@ RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends
git \
libffi-dev \
libltdl-dev \
libpython3.7-dev \
libpython${PYTHON_VERSION}-dev \
libssl-dev \
libtool \
make \
openjdk-8-jdk \
openjdk-${JAVA_VERSION}-jdk \
patch \
pkg-config \
python3.7 \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-venv \
python3-pip \
python3-setuptools \
python \
sudo \
unzip \
xz-utils \
Expand All @@ -59,8 +61,13 @@ RUN useradd --create-home --shell /bin/bash ${USER} && \
USER ${USER}
WORKDIR ${WORK_DIR}

# Create and activate a virtual environment
RUN python3 -m venv ${HOME_DIR}/venv
ENV PATH="${HOME_DIR}/venv/bin:${PATH}" \
VIRTUAL_ENV="${HOME_DIR}/venv"

# install buildozer & dependencies
RUN pip3 install --user --upgrade buildozer Cython==0.28.6
RUN pip install --upgrade buildozer setuptools Cython==0.29.33

COPY . ${WORK_DIR}
# limits the amount of logs for Travis
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile-linux
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix zbarcam-linux 'make uitest'
# Or for interactive shell:
# docker run -it --rm zbarcam-linux
FROM ubuntu:18.04
FROM ubuntu:24.04

ENV USER="user"
ENV HOME_DIR="/home/${USER}"
Expand Down
14 changes: 8 additions & 6 deletions dockerfiles/env.list
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# used by coveralls.io, refs:
# https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#travisci
CI
TRAVIS
TRAVIS_BRANCH
TRAVIS_JOB_ID
TRAVIS_PULL_REQUEST
# used for running UI tests
DISPLAY
# used by coveralls.io, refs:
# https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#travisci
GITHUB_ACTIONS
GITHUB_TOKEN
GITHUB_REF
GITHUB_HEAD_REF
GITHUB_REPOSITORY
GITHUB_SHA
6 changes: 3 additions & 3 deletions requirements/requirements-base.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Kivy==2.0.0rc2
Kivy==2.3.1
Kivy-Garden==0.1.4
numpy==1.18.4
opencv-python==4.2.0.34
numpy==1.26.4
opencv-python==4.8.1.78
Pillow==8.2.0
pyzbar==0.1.8
xcamera==2019.928
12 changes: 10 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[tox]
envlist = pep8,isort-check,py36,py37
envlist = pep8,isort-check,py312
# no setup.py to be ran
skipsdist = True

[testenv]
setenv =
PYTHONPATH = {toxinidir}/src/
SOURCES = src/ tests/ setup.py setup_meta.py
passenv = DISPLAY
passenv =
CI
DISPLAY
GITHUB_*
deps = -r{toxinidir}/requirements.txt
commands = pytest --cov src/ tests/

Expand All @@ -16,3 +19,8 @@ commands = flake8 {env:SOURCES}

[testenv:isort-check]
commands = isort --check-only --recursive --diff {env:SOURCES}

[testenv:coveralls]
setenv =
COVERALLS_SERVICE_NAME = github
commands = coveralls