diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ed56ff4..9814726 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,6 +24,8 @@ on: env: lock_pdm: ${{ ! (github.ref_name == 'refs/heads/latest-release' || inputs.release) }} BACKEND_VERSION: ${{ inputs.backend_version || github.event.client_payload.backend_version || vars.CHIPFLOW_BACKEND_VERSION }} + # Use synth_only for all CI (faster), full only for backend-test (tests complete pipeline) + BUILD_MODE: ${{ github.event_name == 'repository_dispatch' && 'full' || 'synth_only' }} name: CI run-name: ${{ github.event_name == 'repository_dispatch' && format('Backend Test - {0}', github.event.client_payload.backend_version) || (inputs.backend_version && format('CI - Backend {0}', inputs.backend_version) || (inputs.release && 'Release' || 'CI')) }} @@ -35,6 +37,18 @@ jobs: matrix: design: ['mcu_soc', 'minimal'] steps: + - name: Parse PR body for backend version override + id: pr-config + if: github.event_name == 'pull_request' + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + # Extract BACKEND_VERSION from PR body (format: BACKEND_VERSION: ) + if [[ "$PR_BODY" =~ BACKEND_VERSION:[[:space:]]*([^[:space:]]+) ]]; then + echo "backend_version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT + echo "Found BACKEND_VERSION override: ${BASH_REMATCH[1]}" + fi + - name: Check out source code uses: actions/checkout@v4 @@ -69,7 +83,9 @@ jobs: env: CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}} CHIPFLOW_API_ORIGIN: ${{ vars.CHIPFLOW_API_ORIGIN }} - CHIPFLOW_BACKEND_VERSION: ${{ env.BACKEND_VERSION }} + # Priority: PR body override > workflow input > repository_dispatch > vars + CHIPFLOW_BACKEND_VERSION: ${{ steps.pr-config.outputs.backend_version || env.BACKEND_VERSION }} + CHIPFLOW_BUILD_MODE: ${{ env.BUILD_MODE }} test: runs-on: ubuntu-latest diff --git a/pdm.lock b/pdm.lock index 20090e4..70acfce 100644 --- a/pdm.lock +++ b/pdm.lock @@ -206,10 +206,10 @@ dependencies = [ [[package]] name = "chipflow-lib" -version = "0.1.1.dev320" +version = "0.1.1.dev322" requires_python = "<3.14,>=3.11" git = "https://github.com/ChipFlow/chipflow-lib.git" -revision = "43c32b9b1acb199708c5c6256c25353b6d92aac8" +revision = "7fb7cf4b3dab5ba4dc1a44f59907228f6c35ed05" summary = "ChipFlow common tools." groups = ["default"] dependencies = [