Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pytest in github actions #918

Merged
merged 5 commits into from
May 2, 2020
Merged

Conversation

s-martin
Copy link
Collaborator

@s-martin s-martin commented Apr 21, 2020

I added the python tests used by the components to Github Actions to run on commit.

@veloxidSchweiz, could you check, if this makes sense?

@s-martin s-martin marked this pull request as ready for review April 21, 2020 20:17
@veloxidSchweiz
Copy link
Contributor

looks good....
Here my suggestion to fix the docker image ci:

by some change to the docker file you get it to work...


RUN mkdir /code
WORKDIR /code

RUN groupadd --gid 1000 pi ;\
  useradd -u 1000 -g 1000 -G sudo -d /home/pi -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' pi ;\
  chown -R 1000:1000 /code /home/pi


RUN export DEBIAN_FRONTEND=noninteractive ;\
  apt-get update ;\
  apt-get -y install curl gnupg sudo nano python3-pytest  python3-pip ;\
  echo 'deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi' > /etc/apt/sources.list.d/raspi.list ;\
  echo 'deb http://archive.raspberrypi.org/debian/ buster main' >> /etc/apt/sources.list.d/raspi.list

RUN export DEBIAN_FRONTEND=noninteractive ;\
  apt-get update ;\
  apt-get -y dist-upgrade --auto-remove --purge ;\
  apt-get -y install wget build-essential git iw locales wpasupplicant;\
  apt-get clean ;\
  touch /boot/cmdline.txt /etc/sysctl.conf ;\
  rm -rf /var/cache/apt/* /var/lib/apt/lists/*

RUN export DEBIAN_FRONTEND=noninteractive ;\
  curl http://raspbian.raspberrypi.org/raspbian.public.key | apt-key add - ;\
  curl http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add - ;\
  echo 'pi ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/pi ;\
  apt-get clean ;\
  rm -rf /var/cache/apt/* /var/lib/apt/lists/*


RUN export DEBIAN_FRONTEND=noninteractive ;\
  apt-get update ;\
  apt-get -y install curl gnupg sudo nano python3-pytest  python3-pip

RUN pip3 install mock

COPY . /code
RUN  chown -R 1000:1000 /code /home/pi
RUN pip3 install -r /code/components/gpio_control/requirements.txt

RUN chmod +x /code/scripts/installscripts/buster-install-default.sh

ENTRYPOINT pytest-3

USER pi

@s-martin s-martin merged commit 90eab5b into develop May 2, 2020
@s-martin s-martin deleted the use-pytest-in-github-actions branch May 2, 2020 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants