Skip to content

Commit

Permalink
[CI] Change cached_checkout's bool merge param to merge_ref (inte…
Browse files Browse the repository at this point in the history
…l#10333)

I plan to use the extra level of explicit control to lock in build and
e2e-tests steps in pre-commit in the next PR.
  • Loading branch information
aelovikov-intel authored Jul 12, 2023
1 parent aa5e670 commit 38d0b93
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux_matrix_e2e_on_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
ref: ${{ inputs.ref }}
reset_gpu: ${{ matrix.reset_gpu }}
# TODO: should we do the merge?
merge: false
merge_ref: ''

aws_start:
name: AWS Start
Expand All @@ -77,7 +77,7 @@ jobs:
ref: ${{ inputs.ref }}
reset_gpu: false
# TODO: should we do the merge?
merge: false
merge_ref: ''

aws_stop:
name: AWS Stop
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/linux_single_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ on:
type: string
reset_gpu:
type: string
merge:
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from
the default_branch input paramter.
type: string
default: 'FETCH_HEAD'

sycl_toolchain_artifact:
type: string
Expand Down Expand Up @@ -61,10 +65,10 @@ jobs:
with:
path: llvm
ref: ${{ inputs.ref }}
merge_ref: ${{ inputs.merge_ref }}
# We run build and HIP E2E tests under different users on the same
# runners, so need to use distinct cache paths.
cache_path: "/__w/repo_cache_e2e/"
merge: ${{ inputs.merge }}
- name: Install drivers
if: env.compute_runtime_tag != ''
run: |
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/sycl_linux_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ on:
description: 'Filter matches for the changed files in the PR'
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
required: false
merge:
description: 'Merge default branch after the checkout'
type: boolean
default: true
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from
the default_branch input paramter.
type: string
default: 'FETCH_HEAD'
retention-days:
description: 'Artifacts retention period'
type: string
Expand Down Expand Up @@ -111,8 +113,8 @@ jobs:
with:
path: src
ref: ${{ inputs.build_ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
cache_path: "/__w/repo_cache/"
merge: ${{ inputs.merge }}
- name: Configure
env:
CC: ${{ inputs.cc }}
Expand Down Expand Up @@ -231,8 +233,8 @@ jobs:
extra_cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
target_devices: ${{ matrix.targets }}
ref: ${{ inputs.build_ref || github.sha }}
merge_ref: ${{ inputs.merge_ref }}
reset_gpu: ${{ contains(matrix.runs-on, 'gen9') && contains(matrix.runs-on, 'Linux') }}
merge: ${{ inputs.merge }}

sycl_toolchain_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
sycl_toolchain_archive: ${{ inputs.artifact_archive_name }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sycl_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
build_cache_root: "/__w/"
build_artifact_suffix: default-2204
merge: false
merge_ref: ''
retention-days: 90
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
Expand All @@ -39,7 +39,7 @@ jobs:
build_cache_suffix: opaque_pointers
build_artifact_suffix: opaque_pointers-2204
build_configure_extra_args: "--hip --cuda --enable-esimd-emulator --cmake-opt=-DSPIRV_ENABLE_OPAQUE_POINTERS=TRUE"
merge: false
merge_ref: ''

windows_default:
name: Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sycl_post_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }}
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
merge: false
merge_ref: ''

windows_default:
name: Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sycl_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
path: src
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
ref: ${{ github.event.pull_request.head.sha }}
merge_ref: ''
cache_path: "/__w/repo_cache/"
merge: false
- name: Run clang-format
uses: ./devops/actions/clang-format
with:
Expand Down
12 changes: 7 additions & 5 deletions devops/actions/cached_checkout/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ inputs:
default: ${{ github.repository }}
ref:
description: 'Commit-ish to checkout'
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from the
default_branch input paramter.
default: 'FETCH_HEAD'
path:
description: 'Path to checkout repo to'
fetch-depth:
Expand All @@ -16,9 +21,6 @@ inputs:
default_branch:
description: 'Name of the default branch'
default: 'sycl'
merge:
description: 'Merge default branch after the checkout'
default: true

runs:
using: 'composite'
Expand Down Expand Up @@ -51,7 +53,7 @@ runs:
echo $GIT_ALTERNATE_OBJECT_DIRECTORIES > ${{ inputs.path }}/.git/objects/info/alternates
- name: Merge sycl HEAD into current branch
shell: bash
if: ${{ inputs.merge == 'true' }}
if: ${{ inputs.merge_ref != '' }}
env:
DEFAULT_BRANCH: ${{ inputs.default_branch }}
run: |
Expand All @@ -63,4 +65,4 @@ runs:
# Set fake identity to fulfil git requirements
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git merge --no-ff --no-commit origin/$DEFAULT_BRANCH
git merge --no-ff --no-commit ${{ inputs.merge_ref }}

0 comments on commit 38d0b93

Please sign in to comment.