Files
jcm/.gitea/workflows/Test.yml
Jiang f0c188e6dd
Some checks failed
测试 / apt (Home-debian11) (push) Has been cancelled
测试 / apt (Home_armv7-ubuntu20.04) (push) Has been cancelled
测试 / apt (Home-debian12) (push) Has been cancelled
测试 / apt (Home_arm64-ubuntu24.04) (push) Has been cancelled
测试 / apt (Home-kali) (push) Has been cancelled
测试 / apt (Home-ubuntu-20.04) (push) Has been cancelled
测试 / apt (Home-ubuntu-latest) (push) Has been cancelled
测试 / apt (Home-ubuntu18.04) (push) Has been cancelled
测试 / apt (Home-ubuntu20.04) (push) Has been cancelled
测试 / apt (Home-ubuntu24.04) (push) Has been cancelled
测试 / cmd (Windows10) (push) Failing after 7h46m41s
测试 / apt (Home-ubuntu-22.04) (push) Has been cancelled
测试 / apt (Home-ubuntu22.04) (push) Has been cancelled
测试 / apt (Home_arm64-debian11) (push) Has been cancelled
测试 / apt (Home_arm64-debian12) (push) Has been cancelled
测试 / apt (Home_arm64-kali) (push) Has been cancelled
测试 / apt (Home_arm64-ubuntu-20.04) (push) Has been cancelled
测试 / apt (Home_arm64-ubuntu-22.04) (push) Has been cancelled
测试 / apt (Home_arm64-ubuntu-latest) (push) Has been cancelled
测试 / apt (Home_arm64-ubuntu18.04) (push) Has been cancelled
测试 / apt (Home_armv7-debian11) (push) Has been cancelled
测试 / apt (Home_armv7-debian12) (push) Has been cancelled
测试 / apt (Home_armv7-ubuntu18.04) (push) Has been cancelled
测试 / apt (Home_armv7-ubuntu22.04) (push) Has been cancelled
测试 / apt (Home_armv7-ubuntu24.04) (push) Has been cancelled
测试 / dnf (Home-fedora39) (push) Has been cancelled
测试 / dnf (Home-fedora40) (push) Has been cancelled
测试 / dnf (Home-fedora41) (push) Has been cancelled
测试 / dnf (Home-fedora42) (push) Has been cancelled
测试 / pve (push) Successful in 2h24m35s
upp
2026-03-24 13:35:37 +08:00

247 lines
8.2 KiB
YAML

name: 测试
on: [push]
env:
mirror: ${{ vars.GitUrl }}/releases/download/latest_
pipmirror: http://mirrors.aliyun.com/pypi/simple
trusted-host: mirrors.aliyun.com
init-args: init -user=admin -passwd=admin --pipmirror=${{ env.pipmirror }} --trusted-host=${{ env.trusted-host }} --mirror=${{ vars.GitUrl }}
jobs:
apt:
strategy:
matrix:
os:
- Home-ubuntu-latest
- Home-ubuntu-22.04
- Home-ubuntu-20.04
- Home-ubuntu24.04
- Home-ubuntu22.04
- Home-ubuntu20.04
- Home-ubuntu18.04
# - Home-ubuntu16.04
# - Home-ubuntu14.04
- Home-kali
- Home-debian11
- Home-debian12
# ARM64 架构测试
- Home_arm64-ubuntu-latest
- Home_arm64-ubuntu-22.04
- Home_arm64-ubuntu-20.04
- Home_arm64-ubuntu24.04
- Home_arm64-ubuntu18.04
# - Home_arm64-ubuntu16.04
# - Home_arm64-ubuntu14.04
- Home_arm64-kali
- Home_arm64-debian11
- Home_arm64-debian12
# ARMv7 架构测试
- Home_armv7-ubuntu24.04
- Home_armv7-ubuntu22.04
- Home_armv7-ubuntu20.04
- Home_armv7-ubuntu18.04
# - Home_armv7-ubuntu16.04
- Home_armv7-debian11
- Home_armv7-debian12
runs-on: ${{ matrix.os }}
steps:
- name: 系统信息
run: |
echo "::group:: cat /etc/issue"
cat /etc/issue | grep -v " "
echo "::endgroup::"
echo "::group:: lscpu | grep name"
bash -c "lscpu | grep name || cat /proc/cpuinfo | grep name"
echo "::endgroup::"
echo "::group:: df -h"
df -h
echo "::endgroup::"
echo "::group:: lsblk"
lsblk
echo "::endgroup::"
sed -i "s/https:\/\//http:\/\//g" $(grep -rl "http" /etc/apt/sources.*)
if grep -rl "deb.debian.org" /etc/apt/sources.* > /dev/null 2>&1; then
sed -i "s/deb.debian.org/mirrors.aliyun.com/g" $(grep -rl "deb.debian.org" /etc/apt/sources.*)
fi
if grep -rl "archive.ubuntu.com" /etc/apt/sources.* > /dev/null 2>&1; then
sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" $(grep -rl "archive.ubuntu.com" /etc/apt/sources.*)
fi
if grep -rl "security.ubuntu.com" /etc/apt/sources.* > /dev/null 2>&1; then
sed -i "s/security.ubuntu.com/mirrors.aliyun.com/g" $(grep -rl "security.ubuntu.com" /etc/apt/sources.*)
fi
if grep -rl "http.kali.org" /etc/apt/sources.* > /dev/null 2>&1; then
sed -i "s/http.kali.org/mirrors.aliyun.com/g" $(grep -rl "http.kali.org" /etc/apt/sources.*)
fi
echo "" >/etc/apt/sources.list.d/ubuntu-esm-infra-trusty.list
rm /etc/apt/sources.list.d/ubuntu-esm-infra-trusty.list
- name: 安装依赖
run: |
export DEBIAN_FRONTEND=noninteractive
echo "::group:: apt-get update"
apt-get update -q
echo "::endgroup::"
echo "::group:: apt-get install -y curl wget git nodejs npm"
apt-get install -y -q curl wget git nodejs npm
echo "::endgroup::"
- name: 获取存储库
run: |
git clone ${{ vars.GitUrl }} -b latest
# - name: 获取存储库
# uses: ${{ vars.VARIABLE_MIRROR }}/checkout@v4
- name: 准备测试环境
run: |
apt-get install -y -q python3 python3-pip
apt-get install -y -q python3-venv || apt-get install -y -q python3.5-venv
- name: 运行测试脚本
run: |
pwd
ls
cd jcm
python3 -m venv .venv
.venv/bin/python3 server/jcm.py ${{ init-args }}
# python3 server/jcm.py --test -user=admin -passwd=admin --pipmirror=http://mirrors.aliyun.com/pypi/simple --trusted-host=mirrors.aliyun.com
- name: Test Main
run: |
cd jcm
.venv/bin/python3 -m pip install requests -i ${{ env.pipmirror }} --trusted-host ${{ env.trusted-host }}
.venv/bin/python3 -m pip install websocket-client -i ${{ env.pipmirror }} --trusted-host ${{ env.trusted-host }}
.venv/bin/python3 server/jcm.py &
# cd Test
.venv/bin/python3 Test/main/main.py
# yum:
# strategy:
# matrix:
# os:
# - Home-centos7
# - Home-centos8
# - Home_arm64-centos7
# - Home_arm64-centos8
# runs-on: ${{ matrix.os }}
# steps:
# - name: 系统信息
# run: |
# cat /etc/issue
# # lscpu | grep name
# df -h
# lsblk
# echo "10.0.0.250 mirror.centos.org" >>/etc/hosts
# sed -i "s/mirrorlist/#mirrorlist/g" $(grep -rl "mirrorlist" /etc/yum.repos.d/)
# sed -i "s/#baseurl/baseurl/g" $(grep -rl "#baseurl" /etc/yum.repos.d/)
# sed -i "s/https:\/\//http:\/\//g" $(grep -rl "http" /etc/yum.repos.d/)
# - name: 安装依赖
# run: |
# yum install -y curl wget git nodejs npm
# - name: 获取存储库
# uses: ${{ vars.VARIABLE_MIRROR }}/checkout@v4
dnf:
strategy:
matrix:
os:
- Home-fedora39
- Home-fedora40
- Home-fedora41
- Home-fedora42
# - Home_arm64-fedora39
# - Home_arm64-fedora40
# - Home_arm64-fedora41
# - Home_arm64-fedora42
runs-on: ${{ matrix.os }}
steps:
- name: 系统信息
run: |
cat /etc/issue
cat /proc/cpuinfo | grep name
df -h
# lsblk
sed -i "s/https:\/\//http:\/\//g" $(grep -rl "http" /etc/yum.repos.d/)
- name: 安装依赖
run: |
dnf install -y curl wget git nodejs npm
- name: 获取存储库
uses: ${{ vars.VARIABLE_MIRROR }}/checkout@v4
- name: 准备测试环境
run: |
dnf install -y python3 python3-pip
- name: 运行测试脚本
run: |
ls
# python3 server/jcm.py --test
- name: Test Main
run: |
cd jcm
.venv/bin/python3 -m pip install requests -i ${{ env.pipmirror }} --trusted-host ${{ env.trusted-host }}
.venv/bin/python3 -m pip install websocket-client -i ${{ env.pipmirror }} --trusted-host ${{ env.trusted-host }}
.venv/bin/python3 server/jcm.py &
# cd Test
.venv/bin/python3 Test/main/main.py
# pacman:
# strategy:
# matrix:
# os:
# - Home-archlinux
# # - Home_arm64-archlinux
# runs-on: ${{ matrix.os }}
# steps:
# - name: 系统信息
# run: |
# cat /etc/issue
# lscpu | grep name
# df -h
# lsblk
# sed -i "s/https:\/\//http:\/\//g" $(grep -rl "https" /etc/pacman.d/mirrorlist)
# - name: 安装依赖
# run: |
# pacman -Syu --noconfirm curl wget git nodejs npm
# - name: 获取存储库
# uses: ${{ vars.VARIABLE_MIRROR }}/checkout@v4
cmd:
strategy:
matrix:
os:
# - jcm0test0win81
- Windows10
defaults:
run:
shell: cmd
runs-on: ${{ matrix.os }}
steps:
- name: 获取存储库
uses: ${{ vars.VARIABLE_MIRROR }}/checkout@v4
- name: 运行测试脚本
run: |
python3.13 -m venv .venv
.\.venv\Scripts\python server/jcm.py ${{ init-args }}
- name: Test Main
run: |
# cd jcm
set PATH=%PATH%;%CD%\Tools\.bash\bin
.\.venv\Scripts\python -m pip install requests -i ${{ env.pipmirror }} --trusted-host ${{ env.trusted-host }}
.\.venv\Scripts\python -m pip install websocket-client -i ${{ env.pipmirror }} --trusted-host ${{ env.trusted-host }}
start .\.venv\Scripts\python server/jcm.py
# cd Test
.\.venv\Scripts\python Test/main/main.py
pve:
runs-on: pve
steps:
- name: 启动Windows10测试虚拟机
run: |
id=$(qm list | grep ' Gitea-Run-Windows10 ' | awk '{print $1}')
# 还原快照
qm rollback $id initOK
# 启动虚拟机
qm start $id
# 打开终端
qm terminal $id
# 等待虚拟机关机自动关闭终端