diff --git a/.github/workflows/workflow1.yml b/.github/workflows/workflow1.yml index 89b5bed..ad74743 100644 --- a/.github/workflows/workflow1.yml +++ b/.github/workflows/workflow1.yml @@ -28,22 +28,22 @@ jobs: echo "LLVM_VERSION=${{ inputs.llvm_version }}" >> $GITHUB_ENV" echo "UPDATE_CACHE=${{ inputs.update_cache }}" >> $GITHUB_ENV" - run-on-pull: - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: Print the input tag to STDOUT - run: | - echo The llvm_version are ${{ inputs.llvm_version }}, update_cache is ${{ inputs.update_cache }} - cat "$GITHUB_ENV" - echo ${{ github.event }} - echo "LLVM_VERSION=18" >> $env:GITHUB_ENV" - echo "UPDATE_CACHE=false" >> $env:GITHUB_ENV" + # run-on-pull: + # if: ${{ github.event_name == 'pull_request' }} + # runs-on: ubuntu-latest + # steps: + # - name: Print the input tag to STDOUT + # run: | + # echo The llvm_version are ${{ inputs.llvm_version }}, update_cache is ${{ inputs.update_cache }} + # cat "$GITHUB_ENV" + # echo ${{ github.event }} + # echo "LLVM_VERSION=18" >> $env:GITHUB_ENV" + # echo "UPDATE_CACHE=false" >> $env:GITHUB_ENV" run-on-pull_2: name: Call other workflow if: ${{ github.event_name == 'pull_request' }} - needs: run-on-pull + # needs: run-on-pull uses: ./.github/workflows/workflow_callee.yml with: llvm_version: 18 diff --git a/.github/workflows/workflow_callee.yml b/.github/workflows/workflow_callee.yml index 83e7d2d..6eb96e3 100644 --- a/.github/workflows/workflow_callee.yml +++ b/.github/workflows/workflow_callee.yml @@ -18,12 +18,29 @@ on: pull_request: paths: - '.github/workflows/workflow_callee.yml' + +env: + LLVM_VERSION: 17 + UPDATE_CACHE: false jobs: + update-values: + runs-on: ubuntu-latest + steps: + - name: update envs + run: | + if [ -n "${{ inputs.llvm_version}}" ]; then + echo LLVM_VERSION=${{ inputs.llvm_version}} >> $GITHUB_ENV + echo UPDATE_CACHE=${{ inputs.update_cache}} >> $GITHUB_ENV + fi + cat $GITHUB_ENV + print-inputs: runs-on: ubuntu-latest + needs: update-values steps: - name: Print the input tag to STDOUT run: | echo ${{ inputs.llvm_version }} echo ${{ inputs.update_cache }} + echo LLVM="$LLVM_VERSION" CACHE="$UPDATE_CACHE"