yuchanns commented on code in PR #6293:
URL: https://github.com/apache/opendal/pull/6293#discussion_r2157926312


##########
.github/workflows/test_behavior_binding_go.yml:
##########
@@ -28,37 +28,24 @@ on:
         type: string
 
 jobs:
-  set-build:
-    runs-on: ubuntu-latest
-    outputs:
-      build: ${{ steps.set-matrix-build.outputs.build }}
-    steps:
-      - uses: actions/checkout@v4
-      - id: set-matrix-build
-        name: Setup Matrix Build
-        run: |
-          MATRIX=$(yq -o=json -I=0 '[.build[] | select(.os == "${{ inputs.os 
}}")]' .github/scripts/test_go_binding/matrix.yaml | sed 's/ //g')
-          echo "Matrix:"
-          echo "$MATRIX" | jq .
-          echo "build=$MATRIX" >> $GITHUB_OUTPUT
-
   test:
-    needs: [set-build]
     name: ${{ matrix.cases.service }} / ${{ matrix.cases.setup }}
     runs-on: ${{ inputs.os }}
     strategy:
       fail-fast: false
       matrix:
         cases: ${{ fromJson(inputs.cases) }}
-        build: ${{ fromJson(needs.set-build.outputs.build) }}
     steps:
       - uses: actions/checkout@v4
+      - uses: actions/checkout@v4
+        with:
+          path: "opendal"

Review Comment:
   I'm afraid it doesn't work because the `defaults.run.working-directory` does 
not affect files included by the `use` directive.
   ```
   Error: Can't find 'action.yml', 'action.yaml', or 'Dockerfile' in 
'/Users/runner/work/opendal/opendal/.github/actions/setup'. Did you forget to 
run actions/checkout before executing your local action?
   ```
   FROM: 
https://github.com/apache/opendal/actions/runs/15769891273/job/44452823057?pr=6293
   
   Additionally, `${{ github.workspace }}` defaults to 
`/home/runner/work/opendal/opendal`, not `/home/runner/_work`.
   FYI: 
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#example-contents-of-the-github-context
   
   > "workspace": "/home/runner/work/hello-world/hello-world",
   
   To clarify, if you check out with default arguments, it is cloned to 
`/home/runner/work/opendal/opendal`:
   ```yaml
       steps:
         - uses: actions/checkout@v4
   ```
   If you check out with a specified path, for example `opendal`, then it is 
cloned to `/home/runner/work/opendal/opendal/opendal`:
   ```yaml
         - uses: actions/checkout@v4
           with:
             path: opendal
   ```
   In any case, a file always starts with `${{github.workspace}}` 
(`home/runner/work/opendal/opodal`) regardless of what working-directory is set 
by parent files.
   
   In other words, the `working-directory` directive only works with `run` 
directive, and has noting to do with `uses` directive. In fact, if you combine 
`working-directory` and `uses` directly, it is invalid and cannot run.
   
   In conclusion, it doesn't work:
   ```diff
   jobs:
     test:
       # ... 
   +   defaults:
   +     working-directory: opendal
       
       steps:
   -     - uses: actions/checkout@v4
         - uses: actions/checkout@v4
           with:
             path: opendal
         - uses: actions/checkout@v4
           with: 
             repository: "apache/opendal-go-services"
             path: "opendal-go-services"
   -    - uses: ./.github/services/${{ inputs.service }}/${{ inputs.setup }} # 
<-- not work
   +   - uses: ./opendal/.github/services/${{ inputs.service }}/${{ 
inputs.setup }} # <-- work
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@opendal.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to