Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch 'main' into colin/add_on_pull #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/workflow1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/workflow_callee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"