diff --git a/.github/workflows/compatibility_test.yml b/.github/workflows/compatibility_test.yml index d7708ad..0b31a39 100644 --- a/.github/workflows/compatibility_test.yml +++ b/.github/workflows/compatibility_test.yml @@ -16,6 +16,11 @@ name: ✅ Compatibility Test ❌ on: workflow_dispatch: + inputs: + pr_number: + description: 'Target PR Number' + required: true + type: number env: FORCE_COLOR: 1 @@ -34,6 +39,9 @@ jobs: steps: - name: Fetch Code uses: actions/checkout@v4 + + - name: Checkout PR + run: gh pr checkout ${{ github.event.inputs.pr_number }} - name: Set up Python uses: actions/setup-python@v5 @@ -130,6 +138,9 @@ jobs: - name: Fetch Code uses: actions/checkout@v4 + - name: Checkout PR + run: gh pr checkout ${{ github.event.inputs.pr_number }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/minimal_test.yml b/.github/workflows/minimal_test.yml index 61c4c08..ec72fa5 100644 --- a/.github/workflows/minimal_test.yml +++ b/.github/workflows/minimal_test.yml @@ -10,6 +10,7 @@ # - Test cases (/tests) # - Configuration files (default_cfg.yml, requirements.txt) # - Manual trigger via GitHub UI: +# - PR number: the target PR number that needs to be tested # - Select OS: ubuntu/macOS/windows # - Choose Python version: 3.8~3.13 # @@ -35,6 +36,11 @@ on: - 'requirements.txt' workflow_dispatch: inputs: + pr_number: + description: 'Target PR Number' + required: true + type: number + chosen-os: required: true type: choice @@ -42,6 +48,7 @@ on: - ubuntu - macOS - windows + python-version: required: true type: choice @@ -97,6 +104,12 @@ jobs: - name: Fetch Code uses: actions/checkout@v4 + - name: Checkout PR + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + gh pr checkout ${{ github.event.inputs.pr_number }} + fi + - name: Set up Python uses: actions/setup-python@v5 with: @@ -179,6 +192,12 @@ jobs: steps: - name: Fetch Code uses: actions/checkout@v4 + + - name: Checkout PR + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + gh pr checkout ${{ github.event.inputs.pr_number }} + fi - name: Set up Python ${{ needs.Pick-OS-Python.outputs.python_version }} uses: actions/setup-python@v5