Skip to content

Commit 28f6252

Browse files
committed
👷 Migrate to GitHub Actions
Also bump a few versions to get the CI to pass. In future iterations we could bump more dependencies. Bumped versions: - Ubunto 18.04 to 24.04 - Python 3.7 to 3.11 & 3.12 - Cython==0.28.6 to Cython==0.29.15 - Kivy==2.0.0rc2 to Kivy==2.3.1 - p4a v2020.04.29 to v2024.01.21 - hostpython3==3.8.1 to hostpython3==3.10.12 - Android NDK 19b to 25b - OpenJDK 8 to 17
1 parent 8c75846 commit 28f6252

File tree

11 files changed

+120
-46
lines changed

11 files changed

+120
-46
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Android Build
2+
3+
on:
4+
# TODO
5+
# push:
6+
pull_request:
7+
8+
jobs:
9+
android-build:
10+
runs-on: ubuntu-latest
11+
name: Android Build
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Docker
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: Build Docker image
20+
run: |
21+
docker build --tag=zbarcam-android \
22+
--file=dockerfiles/Dockerfile-android \
23+
--build-arg CI .
24+
25+
- name: Build Android app
26+
run: |
27+
docker run --env-file dockerfiles/env.list \
28+
zbarcam-android buildozer android debug
29+
timeout-minutes: 30

.github/workflows/linux-build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Linux Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
linux-build:
9+
runs-on: ubuntu-latest
10+
name: Linux Build
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Docker
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Build Docker image
19+
run: |
20+
docker build --tag=zbarcam-linux \
21+
--file=dockerfiles/Dockerfile-linux \
22+
--build-arg CI .
23+
24+
- name: Setup virtual frame buffer
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y xvfb
28+
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
29+
echo "DISPLAY=:99" >> $GITHUB_ENV
30+
31+
- name: Run tests
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
docker run --env-file dockerfiles/env.list \
36+
-v /tmp/.X11-unix:/tmp/.X11-unix \
37+
-e DISPLAY=$DISPLAY \
38+
zbarcam-linux make test
39+
timeout-minutes: 30

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SYSTEM_DEPENDENCIES= \
2020
libsdl2-image-dev \
2121
libsdl2-mixer-dev \
2222
libsdl2-ttf-dev \
23-
libpython3.7-dev \
23+
libpython$(PYTHON_VERSION)-dev \
2424
libpython$(PYTHON_VERSION)-dev \
2525
libzbar-dev \
2626
pkg-config \
@@ -31,7 +31,7 @@ SYSTEM_DEPENDENCIES= \
3131
virtualenv
3232
OS=$(shell lsb_release -si 2>/dev/null || uname)
3333
PYTHON_MAJOR_VERSION=3
34-
PYTHON_MINOR_VERSION=7
34+
PYTHON_MINOR_VERSION=12
3535
PYTHON_VERSION=$(PYTHON_MAJOR_VERSION).$(PYTHON_MINOR_VERSION)
3636
PYTHON_MAJOR_MINOR=$(PYTHON_MAJOR_VERSION)$(PYTHON_MINOR_VERSION)
3737
PYTHON_WITH_VERSION=python$(PYTHON_VERSION)
@@ -46,7 +46,7 @@ endif
4646

4747
$(VIRTUAL_ENV):
4848
$(PYTHON_WITH_VERSION) -m venv $(VIRTUAL_ENV)
49-
$(PIP) install Cython==0.28.6
49+
$(PIP) install Cython==0.29.15
5050
$(PIP) install -r requirements.txt
5151

5252
virtualenv: $(VIRTUAL_ENV)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# zbarcam
22

3-
[![Build Status](https://travis-ci.org/kivy-garden/zbarcam.svg?branch=develop)](https://travis-ci.org/kivy-garden/zbarcam)
3+
[![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)
4+
[![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)
45
[![Coverage Status](https://coveralls.io/repos/github/kivy-garden/zbarcam/badge.svg?branch=develop)](https://coveralls.io/github/kivy-garden/zbarcam?branch=develop)
56
[![PyPI version](https://badge.fury.io/py/zbarcam.svg)](https://badge.fury.io/py/zbarcam)
67
[![Documentation Status](https://readthedocs.org/projects/zbarcam/badge/?version=latest)](https://zbarcam.readthedocs.io/en/latest/?badge=latest)

buildozer.spec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ version.filename = %(source.dir)s/kivy_garden/zbarcam/version.py
3838
# comma seperated e.g. requirements = sqlite3,kivy
3939
requirements =
4040
android,
41-
hostpython3==3.8.1,
42-
Kivy==58e70b1,
41+
hostpython3==3.10.12,
42+
Kivy==2.3.1,
4343
libiconv,
4444
libzbar,
45-
Pillow==7.0.0,
46-
python3==3.8.1,
45+
Pillow==8.4.0,
46+
python3==3.10.12,
4747
pyzbar==0.1.8,
4848
xcamera==2019.928
4949
@@ -78,7 +78,7 @@ orientation = portrait
7878
osx.python_version = 3
7979
8080
# Kivy version to use
81-
osx.kivy_version = 1.9.1
81+
osx.kivy_version = 2.3.1
8282
8383
#
8484
# Android specific
@@ -107,7 +107,7 @@ android.minapi = 21
107107
android.sdk = 20
108108
109109
# (str) Android NDK version to use
110-
android.ndk = 19b
110+
android.ndk = 25b
111111
112112
# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
113113
android.ndk_api = 21
@@ -219,7 +219,7 @@ android.arch = armeabi-v7a
219219
#p4a.fork = kivy
220220
221221
# (str) python-for-android branch to use, defaults to master
222-
p4a.branch = v2020.04.29
222+
p4a.branch = v2024.01.21
223223
224224
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
225225
#p4a.source_dir =

dockerfiles/Dockerfile-android

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
# docker run zbarcam-android 'buildozer android debug'
88
# Or for interactive shell:
99
# docker run -it --rm zbarcam-android
10-
FROM ubuntu:18.04
10+
FROM ubuntu:24.04
1111

1212
ARG CI=false
13+
ARG PYTHON_VERSION=3.12
14+
ARG JAVA_VERSION=17
1315
ENV USER="user"
1416
ENV HOME_DIR="/home/${USER}"
1517
ENV WORK_DIR="${HOME_DIR}" \
@@ -35,16 +37,16 @@ RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends
3537
git \
3638
libffi-dev \
3739
libltdl-dev \
38-
libpython3.7-dev \
40+
libpython${PYTHON_VERSION}-dev \
3941
libssl-dev \
4042
libtool \
4143
make \
42-
openjdk-8-jdk \
44+
openjdk-${JAVA_VERSION}-jdk \
45+
patch \
4346
pkg-config \
44-
python3.7 \
47+
python${PYTHON_VERSION} \
48+
python${PYTHON_VERSION}-venv \
4549
python3-pip \
46-
python3-setuptools \
47-
python \
4850
sudo \
4951
unzip \
5052
xz-utils \
@@ -59,8 +61,13 @@ RUN useradd --create-home --shell /bin/bash ${USER} && \
5961
USER ${USER}
6062
WORKDIR ${WORK_DIR}
6163

64+
# Create and activate a virtual environment
65+
RUN python3 -m venv ${HOME_DIR}/venv
66+
ENV PATH="${HOME_DIR}/venv/bin:${PATH}" \
67+
VIRTUAL_ENV="${HOME_DIR}/venv"
68+
6269
# install buildozer & dependencies
63-
RUN pip3 install --user --upgrade buildozer Cython==0.28.6
70+
RUN pip install --upgrade buildozer setuptools Cython==0.29.33
6471

6572
COPY . ${WORK_DIR}
6673
# limits the amount of logs for Travis

dockerfiles/Dockerfile-linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix zbarcam-linux 'make uitest'
1111
# Or for interactive shell:
1212
# docker run -it --rm zbarcam-linux
13-
FROM ubuntu:18.04
13+
FROM ubuntu:24.04
1414

1515
ENV USER="user"
1616
ENV HOME_DIR="/home/${USER}"

dockerfiles/env.list

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# used by coveralls.io, refs:
22
# https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#travisci
33
CI
4-
TRAVIS
5-
TRAVIS_BRANCH
6-
TRAVIS_JOB_ID
7-
TRAVIS_PULL_REQUEST
4+
# TODO: needed?
5+
GITHUB_*
6+
GITHUB_ACTIONS
7+
GITHUB_TOKEN
8+
# TODO: needed?
9+
COVERALLS_REPO_TOKEN
810
# used for running UI tests
911
DISPLAY

requirements/requirements-base.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Kivy==2.0.0rc2
1+
Kivy==2.3.1
22
Kivy-Garden==0.1.4
3-
numpy==1.18.4
4-
opencv-python==4.2.0.34
3+
numpy==1.26.4
4+
opencv-python==4.8.1.78
55
Pillow==8.2.0
66
pyzbar==0.1.8
77
xcamera==2019.928

0 commit comments

Comments
 (0)