Skip to content

Commit

Permalink
ci/ubuntu: add Scopy x86-64 appimage workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Bindea Cristian <[email protected]>
  • Loading branch information
bindea-cristian committed Apr 26, 2024
1 parent de0cb5d commit e62e776
Show file tree
Hide file tree
Showing 6 changed files with 493 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/appimageubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Ubuntu Scopy Appimage Build

on: [push, pull_request]

env:
BUILD_HOST: ubuntu-20.04
USERNAME: github-actions

jobs:

build_scopy1_ubuntu_appimage:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
set-safe-directory: 'true'

- name: Pull the Docker Image
run: docker pull cristianbindea/scopy1-ubuntu-appimage:latest

- name: Create Scopy AppImage
shell: bash
run: |
cd $GITHUB_WORKSPACE
./CI/appimage/ubuntu_appimage_process.sh generate_ci_envs
docker run \
--mount type=bind,source="$GITHUB_WORKSPACE",target=/home/runner/scopy \
--env-file $GITHUB_WORKSPACE/CI/appimage/gh-actions.envs \
cristianbindea/scopy1-ubuntu-appimage:latest \
/bin/bash -c 'cd $HOME && \
sudo chown -R runner:runner scopy && \
cd $HOME/scopy && \
./CI/appimage/ubuntu_appimage_process.sh download_tools build_iio-emu build_scopy create_appdir create_appimage move_appimage
'
- name: Set short git commit SHA
shell: bash
run: echo "commit_sha=$(git rev-parse --short ${{ github.sha }})" >> "$GITHUB_ENV"

- uses: actions/upload-artifact@v4
with:
name: scopy-linux-armhf-${{ env.commit_sha }}
path: ${{ github.workspace }}/Scopy1-x86_64.AppImage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ android*.sh
!CI/android/*
CI/kuiper/staging
CI/kuiper/scopy.AppDir
CI/appimage/staging
html/
build_arm64-v8a/
10 changes: 10 additions & 0 deletions CI/appimage/AppRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
SELF=$(readlink -f "$0")
HERE=${SELF%/*}

export QT_PLUGIN_PATH=$HERE/usr/plugins
export QT_QPA_PLATFORM_PLUGIN_PATH=$HERE/usr/plugins/platforms
export LD_LIBRARY_PATH=$HERE/usr/lib

exec $HERE/usr/bin/scopy
35 changes: 35 additions & 0 deletions CI/appimage/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#docker build -t cristianbindea/scopy1-ubuntu-appimage .
#DOCKER_BUILDKIT=0
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]

ARG USER=runner
ARG DEBIAN_FRONTEND=noninteractive

ENV TZ=Europe/Bucharest
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get -y upgrade && apt-get install -y apt-utils sudo git tzdata keyboard-configuration

RUN groupadd -g 1000 -r $USER && \
useradd -u 1000 -g 1000 --create-home -r $USER

#Change password
RUN echo "$USER:$USER" | chpasswd

#Make sudo passwordless
RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-$USER && \
usermod -aG sudo $USER && \
usermod -aG plugdev $USER

USER $USER
WORKDIR /home/${USER}
RUN git clone https://github.com/analogdevicesinc/scopy --branch appimage-scopy1
WORKDIR /home/${USER}/scopy

RUN ./CI/appimage/ubuntu_appimage_process.sh install_packages
RUN sudo pip3 install aqtinstall && sudo python3 -m aqt install-qt --outputdir /opt/Qt linux desktop 5.15.2
RUN ./CI/appimage/ubuntu_appimage_process.sh clone download_tools build_deps

# to be set at runtime CI_SCRIPT=ON
WORKDIR /home/${USER}
# RUN rm -rf scopy
10 changes: 10 additions & 0 deletions CI/appimage/scopy.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Icon=Scopy
Exec=scopy
Terminal=false
Type=Application
Categories=Science
Name=Scopy
GenericName=Oscilloscope
Comment=A software oscilloscope
Loading

0 comments on commit e62e776

Please sign in to comment.