From 7c33894792b458e2b3c64975a04e6f8a635706e2 Mon Sep 17 00:00:00 2001 From: Ace Date: Fri, 18 Aug 2023 01:15:09 +0200 Subject: [PATCH] Create test-on-rpi.yml --- .github/workflows/test-on-rpi.yml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/test-on-rpi.yml diff --git a/.github/workflows/test-on-rpi.yml b/.github/workflows/test-on-rpi.yml new file mode 100644 index 0000000..730afc2 --- /dev/null +++ b/.github/workflows/test-on-rpi.yml @@ -0,0 +1,54 @@ +name: Run tests on Raspberry Pi OS + +on: + push: + branches: + - main + +jobs: + test-on-rpi-os: + name: Run Tests on Raspberry Pi OS + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Build Raspberry Pi OS + uses: pguyot/arm-runner-action@v2 + id: build_image + env: + INKY_INITAL_PASSWORD: ${{ secrets.INKY_INITAL_PASSWORD }} + OPENWEATHERMAP_API_KEY: ${{ secrets.OPENWEATHERMAP_API_KEY }} + SAMPLE_ICAL_URL: ${{ secrets.SAMPLE_ICAL_URL }} + TEST_ICAL_URL: ${{ secrets.TEST_ICAL_URL }} + TODOIST_API_KEY: ${{ secrets.TODOIST_API_KEY }} + with: + # Set the base_image to the desired Raspberry Pi OS version + base_image: https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz + image_additional_mb: 1500 # enlarge free space to 1.5 GB + optimize_image: true + user: inky + commands: | + cd /home + sudo useradd -m -p "$(openssl passwd -1 $INKY_INITAL_PASSWORD)" inky + sudo usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,gpio,i2c,spi inky + sudo su inky + echo $HOME + whoami + cd /home/inky + sudo apt-get update -y + python --version + sudo apt-get install -y python3-pip + sudo apt-get install zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python3-dev scons libssl-dev python3-venv python3-pip git libfreetype6-dev -y + echo $PWD && ls + git clone --branch main --single-branch https://github.com/aceinnolab/Inkycal + cd Inkycal + python3 -m venv venv + . venv/bin/activate + python -m pip install --upgrade pip + pip install wheel + pip install -e ./ + pip install RPi.GPIO==0.7.1 spidev==3.5 + cd inkycal/tests + wget https://raw.githubusercontent.com/aceinnolab/Inkycal/assets/tests/settings.json + for f in *.py; do python3 "$f"; done