Skip to content

Commit

Permalink
add github worlflow yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Pillar1989 committed Dec 6, 2023
1 parent bd18df1 commit 1f1b8ef
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 14 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Compile Sophgo CV18XX Image
on:
workflow_dispatch:
push:
branches:
- vizos
paths:
- 'build/Tianling_source/start-up/start'

schedule:
- cron: 0 17 * * 5

env:
Github: https://github.com/${{github.repository}}
Author: ${{github.actor}}
Apidz: ${{github.repository}}
Run_number: ${{github.run_number}}
Run_workflow: ${{github.workflow}}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
TZ: Asia/Shanghai

jobs:
build:
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id

name: Compile "${{matrix.target}}"
strategy:
fail-fast: false
matrix:
target: [OpenWrt_source]

steps:
- name: Checkout
uses: actions/checkout@v3


- name: Prepare build env
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
sudo -E rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d /usr/local/lib/android
sudo -E apt-mark hold grub-efi-amd64-signed
sudo -E apt update
sudo -E apt -y purge azure-cli* docker* ghc* zulu* llvm* firefox google* dotnet* powershell* openjdk* mysql* php* mongodb* dotnet* snap*
sudo -E apt -y full-upgrade
sudo -E apt -y install ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip libpython3-dev qemu-utils rsync rename scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
sudo -E systemctl daemon-reload
sudo -E apt -y autoremove --purge
sudo -E apt clean
sudo -E timedatectl set-timezone "Asia/Shanghai"
echo "================================================="
echo "文件系统 类型 容量 已用 可用 使用% 挂载点"
df -hT $PWD
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /${{matrix.target}}
sudo chown $USER:$GROUPS /${{matrix.target}}
wget https://sophon-file.sophon.cn/sophon-prod-s3/drive/23/03/07/16/host-tools.tar.gz
tar xf host-tools.tar.gz
sudo mv host-tools /opt/host-tools
wget https://mirrors.sdu.edu.cn/ubuntu/ubuntu/pool/universe/g/genimage/genimage_16-2_amd64.deb
sudo apt install libconfuse2 genext2fs
sudo dpkg -i genimage_16-2_amd64.deb
rm genimage_16-2_amd64.deb
- name: Compile Milk-V Duo Image
id: compile-milk-v-duo
working-directory: /${{matrix.target}}
run: |
git clone -b vizos --single-branch https://github.com/Pillar1989/VizOS feeds-vizos
git clone https://github.com/Pillar1989/openwrt --single-branch
echo "src-link vizos ${PWD}/feeds-vizos" >> openwrt/feeds.conf.default
cd openwrt
cat feeds.conf.default
./scripts/feeds update vizos
./scripts/feeds install vizos
./scripts/feeds install -f sophgo
./scripts/feeds install -f uboot-sophgo
cp ../feeds-vizos/configs/cv180x-config .config
echo -e "$(nproc) thread compile"
make -j$(nproc) || make package/feeds/vizos/uboot-sophgo/compile V=s
make -j1 V=s
echo "::set-output name=status::success"
- name: Upload Milk-V Duo Image
if: steps.compile-milk-v-duo.outputs.status == 'success'
uses: actions/upload-artifact@master
with:
name: milk-v-duo-image
path: /${{matrix.target}}/openwrt/bin/targets/sophgo/cv180x/


- name: Compile HuashanPi Image
id: compile-huashanpi
run: |
cd /${{matrix.target}}/openwrt
cp ../feeds-vizos/configs/cv181x-config .config
echo -e "$(nproc) thread compile"
make -j$(nproc) || make package/feeds/vizos/uboot-sophgo/compile V=s
make -j1 V=s
echo "::set-output name=status::success"
- name: Upload Huashan Pi Image
if: steps.compile-huashanpi.outputs.status == 'success'
uses: actions/upload-artifact@master
with:
name: huashanpi-image
path: /${{matrix.target}}/openwrt/bin/targets/sophgo/cv180x/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# *VizOS is a open source IP Camera OS base Openwrt*
## *VizOS is an open-source IP Camera OS based on OpenWrt*
1 change: 1 addition & 0 deletions boot/uboot-sophgo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ UBOOT_TARGETS := \

define Build/InstallDev
$(INSTALL_DIR) $(BIN_DIR)
mkdir -p $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/u-boot.bin $(STAGING_DIR_IMAGE)/u-boot.bin
endef

Expand Down
12 changes: 6 additions & 6 deletions configs/cv180x-config
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ CONFIG_FEED_packages=y
CONFIG_FEED_luci=y
CONFIG_FEED_routing=y
CONFIG_FEED_telephony=y
CONFIG_FEED_sophgo=y
CONFIG_FEED_vizos=y

#
# Base system
Expand Down Expand Up @@ -1557,7 +1557,7 @@ CONFIG_PACKAGE_libc=y
#
# Configuration
#
CONFIG_LIBC_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBC_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBC_FILE_SPEC="./sysroot/lib/ld-musl-riscv64-sf.so.1 ./sysroot/lib/ld-musl-riscv64.so.1 ./sysroot/lib/ld-musl-riscv64v0p7_xthead.so.1 ./sysroot/lib/ld-musl-riscv64v_xthead.so.1 ./sysroot/lib/ld-musl-riscv64xthead-sf.so.1 ./sysroot/lib/ld-musl-riscv64xthead.so.1 ./sysroot/usr/lib64/lp64d/libc.so ./sysroot/usr/lib64xthead/lp64d/libc.so"
# end of Configuration

Expand All @@ -1566,7 +1566,7 @@ CONFIG_PACKAGE_libgcc=y
#
# Configuration
#
CONFIG_LIBGCC_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGCC_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGCC_FILE_SPEC="./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgcc_s.so ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgcc_s.so.1 ./sysroot/lib64/lp64d/libgcc_s.so ./sysroot/lib64/lp64d/libgcc_s.so.1 ./sysroot/lib64xthead/lp64d/libgcc_s.so ./sysroot/lib64xthead/lp64d/libgcc_s.so.1"
# end of Configuration

Expand All @@ -1575,7 +1575,7 @@ CONFIG_PACKAGE_libgomp=y
#
# Configuration
#
CONFIG_LIBGOMP_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGOMP_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGOMP_FILE_SPEC="./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgomp.so ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgomp.so.1 ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgomp.so.1.0.0 ./sysroot/lib64/lp64d/libgomp.so ./sysroot/lib64/lp64d/libgomp.so.1 ./sysroot/lib64/lp64d/libgomp.so.1.0.0 ./sysroot/lib64xthead/lp64d/libgomp.so ./sysroot/lib64xthead/lp64d/libgomp.so.1 ./sysroot/lib64xthead/lp64d/libgomp.so.1.0.0"
# end of Configuration

Expand All @@ -1584,7 +1584,7 @@ CONFIG_PACKAGE_libpthread=y
#
# Configuration
#
CONFIG_LIBPTHREAD_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBPTHREAD_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBPTHREAD_FILE_SPEC="./lib/libpthread{-*.so,.so.*}"
# end of Configuration

Expand All @@ -1594,7 +1594,7 @@ CONFIG_PACKAGE_libstdcpp=y
#
# Configuration
#
CONFIG_LIBSTDCPP_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBSTDCPP_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBSTDCPP_FILE_SPEC="./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so.6 ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so.6.0.28 ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so.6.0.28-gdb.py ./sysroot/lib64/lp64d/libstdc++.so ./sysroot/lib64/lp64d/libstdc++.so.6 ./sysroot/lib64/lp64d/libstdc++.so.6.0.28 ./sysroot/lib64/lp64d/libstdc++.so.6.0.28-gdb.py ./sysroot/lib64xthead/lp64d/libstdc++.so ./sysroot/lib64xthead/lp64d/libstdc++.so.6 ./sysroot/lib64xthead/lp64d/libstdc++.so.6.0.28 ./sysroot/lib64xthead/lp64d/libstdc++.so.6.0.28-gdb.py"
# end of Configuration

Expand Down
12 changes: 6 additions & 6 deletions configs/cv181x-config
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ CONFIG_FEED_packages=y
CONFIG_FEED_luci=y
CONFIG_FEED_routing=y
CONFIG_FEED_telephony=y
CONFIG_FEED_sophgo=y
CONFIG_FEED_vizos=y

#
# Base system
Expand Down Expand Up @@ -1557,7 +1557,7 @@ CONFIG_PACKAGE_libc=y
#
# Configuration
#
CONFIG_LIBC_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBC_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBC_FILE_SPEC="./sysroot/lib/ld-musl-riscv64-sf.so.1 ./sysroot/lib/ld-musl-riscv64.so.1 ./sysroot/lib/ld-musl-riscv64v0p7_xthead.so.1 ./sysroot/lib/ld-musl-riscv64v_xthead.so.1 ./sysroot/lib/ld-musl-riscv64xthead-sf.so.1 ./sysroot/lib/ld-musl-riscv64xthead.so.1 ./sysroot/usr/lib64/lp64d/libc.so ./sysroot/usr/lib64xthead/lp64d/libc.so"
# end of Configuration

Expand All @@ -1566,7 +1566,7 @@ CONFIG_PACKAGE_libgcc=y
#
# Configuration
#
CONFIG_LIBGCC_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGCC_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGCC_FILE_SPEC="./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgcc_s.so ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgcc_s.so.1 ./sysroot/lib64/lp64d/libgcc_s.so ./sysroot/lib64/lp64d/libgcc_s.so.1 ./sysroot/lib64xthead/lp64d/libgcc_s.so ./sysroot/lib64xthead/lp64d/libgcc_s.so.1"
# end of Configuration

Expand All @@ -1575,7 +1575,7 @@ CONFIG_PACKAGE_libgomp=y
#
# Configuration
#
CONFIG_LIBGOMP_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGOMP_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBGOMP_FILE_SPEC="./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgomp.so ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgomp.so.1 ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libgomp.so.1.0.0 ./sysroot/lib64/lp64d/libgomp.so ./sysroot/lib64/lp64d/libgomp.so.1 ./sysroot/lib64/lp64d/libgomp.so.1.0.0 ./sysroot/lib64xthead/lp64d/libgomp.so ./sysroot/lib64xthead/lp64d/libgomp.so.1 ./sysroot/lib64xthead/lp64d/libgomp.so.1.0.0"
# end of Configuration

Expand All @@ -1584,7 +1584,7 @@ CONFIG_PACKAGE_libpthread=y
#
# Configuration
#
CONFIG_LIBPTHREAD_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBPTHREAD_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBPTHREAD_FILE_SPEC="./lib/libpthread{-*.so,.so.*}"
# end of Configuration

Expand All @@ -1594,7 +1594,7 @@ CONFIG_PACKAGE_libstdcpp=y
#
# Configuration
#
CONFIG_LIBSTDCPP_ROOT_DIR="/home/baozhu/storage/cv181x/cvi_mmf_sdk/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBSTDCPP_ROOT_DIR="/opt/host-tools/gcc/riscv64-linux-musl-x86_64"
CONFIG_LIBSTDCPP_FILE_SPEC="./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so.6 ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so.6.0.28 ./riscv64-unknown-linux-musl/lib64xthead/lp64d/libstdc++.so.6.0.28-gdb.py ./sysroot/lib64/lp64d/libstdc++.so ./sysroot/lib64/lp64d/libstdc++.so.6 ./sysroot/lib64/lp64d/libstdc++.so.6.0.28 ./sysroot/lib64/lp64d/libstdc++.so.6.0.28-gdb.py ./sysroot/lib64xthead/lp64d/libstdc++.so ./sysroot/lib64xthead/lp64d/libstdc++.so.6 ./sysroot/lib64xthead/lp64d/libstdc++.so.6.0.28 ./sysroot/lib64xthead/lp64d/libstdc++.so.6.0.28-gdb.py"
# end of Configuration

Expand Down
2 changes: 1 addition & 1 deletion sophgo/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ define Image/Build
mkimage -f ${STAGING_DIR_IMAGE}/multi.its ${STAGING_DIR_IMAGE}/boot.sd
# ${PWD}/image/genimage.sh -c ${PWD}/image/genimage.cfg

genimage --rootpath $(call mkfs_target_dir,$(1)) --inputpath $(STAGING_DIR_IMAGE) --outputpath $(BIN_DIR) --config ${PWD}/image/genimage.cfg
rm -rf ${PWD}/image/tmp || true
genimage --rootpath $(call mkfs_target_dir,$(1)) --inputpath $(STAGING_DIR_IMAGE) --outputpath $(BIN_DIR) --config ${PWD}/image/genimage.cfg
endef


Expand Down

0 comments on commit 1f1b8ef

Please sign in to comment.