From c45aa4948503d79400d0073bee0dc88eb1558faf Mon Sep 17 00:00:00 2001 From: why Date: Thu, 20 Nov 2025 23:04:50 +0800 Subject: [PATCH] Feat: Add basic CI workflow --- .github/workflows/pr-check.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pr-check.yml diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 0000000..9804597 --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,30 @@ +YAML +# .github/workflows/pr-check.yml +name: PR Check +# 触发器:当有 PR 提交到 develop 分支时运行 +on: + pull_request: + branches: [ develop ] +# 任务 +jobs: + # 任务 ID,可自定义 + build-and-test: + # 运行环境:使用最新的 Ubuntu + runs-on: ubuntu-latest + # 步骤 + steps: + # 步骤 1:检出代码 + - name: Check out repository code + uses: actions/checkout@v4 + # 步骤 2:安装 Node.js (模拟一个真实环境) + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: '20.x' + # 步骤 3:运行一个模拟的 "test" + - name: Run a mock test + run: | + echo "Simulating tests..." + echo "Running linter..." + sleep 10 + echo "All tests passed!" \ No newline at end of file