更新 .gitea/workflows/update-rules.yml
All checks were successful
Basic Test / test (push) Successful in 2s

This commit is contained in:
2025-09-11 22:42:39 -07:00
parent 920b475109
commit 30a0e23bc4

View File

@@ -1,99 +1,19 @@
name: Test Act Runner name: Basic Test
# 触发条件
on: on:
push: push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
# 支持手动触发
workflow_dispatch: workflow_dispatch:
jobs: jobs:
test-basic: test:
name: 基础功能测试
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# 1. 检出代码 - name: Hello World
- name: 检出代码 run: echo "Hello from Gitea Act Runner!"
uses: actions/checkout@v3
# 2. 系统信息 - name: System Info
- name: 显示系统信息
run: | run: |
echo "=== 系统信息 ===" echo "当前时间: $(date)"
uname -a echo "工作目录: $(pwd)"
echo "=== 工作目录 ===" echo "用户: $(whoami)"
pwd
ls -la
echo "=== 环境变量 ==="
env | sort
# 3. 测试基本命令
- name: 测试基本命令
run: |
echo "Hello from Gitea Act Runner!"
date
whoami
# 4. 创建测试文件
- name: 创建测试文件
run: |
echo "Act Runner 测试成功!" > test-file.txt
echo "当前时间: $(date)" >> test-file.txt
cat test-file.txt
# 5. 测试多行脚本
- name: 多行脚本测试
run: |
for i in {1..5}; do
echo "第 $i 次循环"
done
test-matrix:
name: 矩阵构建测试
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1.0', '2.0', '3.0']
steps:
- name: 矩阵测试 - 版本 ${{ matrix.version }}
run: |
echo "正在测试版本: ${{ matrix.version }}"
echo "构建完成"
test-conditions:
name: 条件执行测试
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v3
- name: 条件执行 - 总是执行
if: always()
run: echo "这个步骤总是会执行"
- name: 条件执行 - 成功时执行
if: success()
run: echo "前面的步骤都成功了"
test-artifacts:
name: 文件传输测试
runs-on: ubuntu-latest
steps:
- name: 创建测试文件
run: |
mkdir -p test-output
echo "测试内容" > test-output/result.txt
echo "构建时间: $(date)" > test-output/build-info.txt
- name: 上传构建产物
uses: actions/upload-artifact@v3
with:
name: test-artifacts
path: test-output/
retention-days: 1