更新 .gitea/workflows/update-rules.yml
All checks were successful
Basic Test / test (push) Successful in 2s
All checks were successful
Basic Test / test (push) Successful in 2s
This commit is contained in:
@@ -1,99 +1,19 @@
|
||||
name: Test Act Runner
|
||||
name: Basic Test
|
||||
|
||||
# 触发条件
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
# 支持手动触发
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-basic:
|
||||
name: 基础功能测试
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 1. 检出代码
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v3
|
||||
- name: Hello World
|
||||
run: echo "Hello from Gitea Act Runner!"
|
||||
|
||||
# 2. 系统信息
|
||||
- name: 显示系统信息
|
||||
- name: System Info
|
||||
run: |
|
||||
echo "=== 系统信息 ==="
|
||||
uname -a
|
||||
echo "=== 工作目录 ==="
|
||||
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
|
||||
echo "当前时间: $(date)"
|
||||
echo "工作目录: $(pwd)"
|
||||
echo "用户: $(whoami)"
|
||||
Reference in New Issue
Block a user