Files
chsrc/.github/workflows/PR-test.yml
dependabot[bot] b8ff421a8a Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 10:50:06 +08:00

73 lines
1.8 KiB
YAML

# ---------------------------------------------------------------
# Workflow File : PR-test.yml
# File Authors : 曾奥然 <ccmywish@qq.com>
# Contributors : Mikachu2333 <mikachu2333@zohomail.com>
# |
# Created On : <2025-06-19>
# Last Modified : <2025-08-17>
#
# Test PR
# ---------------------------------------------------------------
name: 测试PR
on:
pull_request:
# 仅在开 pr、草稿转正式、手动要求 review、reopen的时候运行测试
types: [
opened,
# 因 synchronize 将导致 pr 的构建过于频繁而禁用
# synchronize, # 在 pr 者 push commit 时每次构建
ready_for_review, # draft PR 转为正式 PR
review_requested,
reopened,
]
paths:
- "src/**"
- "lib/**"
jobs:
test-on-ubuntu:
name: 在Ubuntu上测试
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'dev'
steps:
- name: 检出代码
uses: actions/checkout@v6
- name: 测试构建情况
run: |
make
- name: 测试test情况
run: |
make test
test-on-windows:
name: 在Windows上测试
runs-on: windows-latest
if: github.event.pull_request.base.ref == 'dev'
steps:
- name: 检出代码
uses: actions/checkout@v6
- name: 创建测试文件
shell: powershell
run: |
New-Item -Path "$env:USERPROFILE\Documents\Powershell\Microsoft.PowerShell_profile.ps1" -ItemType File -Force
New-Item -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -ItemType File -Force
- name: 安装依赖
run: |
choco install just
- name: 测试构建情况
run: |
just
- name: 测试test情况
run: |
just test