Skip to content

Commit 6e4df06

Browse files
committed
TODO/WIP/pending 👷 Migrate to GitHub Actions
Also bump a few versions to get the CI to pass. In future iterations we could bump more dependencies. TODO: - explain why we removed dependencies from the Makefile
1 parent 8c75846 commit 6e4df06

File tree

4 files changed

+66
-7
lines changed

4 files changed

+66
-7
lines changed

.github/workflows/tests.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
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+
run: |
33+
docker run --env-file dockerfiles/env.list \
34+
-v /tmp/.X11-unix:/tmp/.X11-unix \
35+
-e DISPLAY=$DISPLAY \
36+
zbarcam-linux make test
37+
timeout-minutes: 30
38+
39+
android-build:
40+
runs-on: ubuntu-latest
41+
name: Android Build
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Set up Docker
47+
uses: docker/setup-buildx-action@v3
48+
49+
- name: Build Docker image
50+
run: |
51+
docker build --tag=zbarcam-android \
52+
--file=dockerfiles/Dockerfile-android \
53+
--build-arg CI .
54+
55+
- name: Build Android app
56+
run: |
57+
docker run --env-file dockerfiles/env.list \
58+
zbarcam-android buildozer android debug
59+
timeout-minutes: 30

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)

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

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)