Update and rename build-doc-and-os.yml to update-docs.yml

This commit is contained in:
Ace 2023-08-18 01:04:13 +02:00 committed by GitHub
parent 7fa3f0ed45
commit 77631efcb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 131 deletions

View File

@ -1,131 +0,0 @@
name: Inkycal testing
on:
push:
branches:
- main
jobs:
update-docs:
name: update docs
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install wheel
pip install -e .
cd ..
- name: Generate Docs
run: |
sudo apt-get install python3-sphinx
pip install sphinxemoji sphinx_rtd_theme recommonmark
cd docsource
make html && make github && cd ..
- name: Check if there are any changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: push docs
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add docs/*
git commit -m "update docs [bot]"
git push
test-on-arm:
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
# enable SPI
sudo sed -i s/#dtparam=spi=on/dtparam=spi=on/ /boot/config.txt
# enable inkycal start at boot
sudo -u inky bash -c 'echo "@reboot sleep 60 && cd /home/inky/Inkycal && venv/bin/python inky_run.py &" | crontab -'
sudo chown inky:crontab /var/spool/cron/crontabs/inky
# fix permissions of Inkycal folder recursively
sudo chown -R inky:inky /home/inky/Inkycal
# make all users require a password for sudo commands (improves security)
echo 'ALL ALL=(ALL:ALL) PASSWD: ALL' | sudo tee -a /etc/sudoers.d/010_require_sudo_password
- name: Compress the release image
run: |
mv ${{ steps.build_image.outputs.image }} inkycal_os_lite.img
xz -0 -T 0 -v inkycal_os_lite.img
- name: Get latest release version
run: |
export tag="$(curl -s https://api.github.com/repos/aceinnolab/Inkycal/releases/latest | jq -r '.tag_name')"
echo "version=${tag}" >> $GITHUB_ENV
- name: Upload Raspberry Pi OS Image
if: success() # Only upload the image if the tests were successful
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
files: inkycal_os_lite.img.xz

52
.github/workflows/update-docs.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: update docs
on:
push:
branches:
- main
jobs:
update-docs:
name: update docs
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install wheel
pip install -e .
cd ..
- name: Generate Docs
run: |
sudo apt-get install python3-sphinx
pip install sphinxemoji sphinx_rtd_theme recommonmark
cd docsource
make html && make github && cd ..
- name: Check if there are any changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: push docs
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add docs/*
git commit -m "update docs [bot]"
git push