Skip to content

Commit

Permalink
TODO/WIP/pending 👷 Migrate to GitHub Actions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AndreMiras committed Feb 25, 2025
1 parent 8c75846 commit 6e4df06
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 7 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

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 \
--build-arg CI .
- 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
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

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 \
--build-arg CI .
- name: Build Android app
run: |
docker run --env-file dockerfiles/env.list \
zbarcam-android buildozer android debug
timeout-minutes: 30
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
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
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

0 comments on commit 6e4df06

Please sign in to comment.