-
Notifications
You must be signed in to change notification settings - Fork 790
[CI] Add reusable workflow for SYCL builds #4773
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
408acd0
[CI] Add reusable workflow for SYCL builds
alexbatashev 58d98ce
pull_request fixes
alexbatashev 057f5f3
use the right image
alexbatashev 6e53c7d
small updates
alexbatashev 701c57e
lit fixes
alexbatashev f1ee2ca
Update .github/workflows/sycl_linux_build_and_test.yml
936df23
Merge remote-tracking branch 'upstream/sycl' into common_sycl_pipeline
7dd6045
switch to another wa
4679ed7
another attempt
67535f2
Remove unnecessary clause
4f8dd53
Update sycl_linux_build_and_test.yml
4288fdd
Correctly use su
4ac803e
chown tmp
2252b21
TEMPDIR -> RUNNER_TEMP
a82ee64
update docker options
b488ba8
correct cache path
aa5817d
add gid
f745e58
temporarily disable failing tests
408afd7
make actions happier
e34fe6b
Revert "make actions happier"
db46ac3
Revert "temporarily disable failing tests"
777e88b
try
8af35ea
add clean-up step
4065cae
fix packaging
50e1687
set XDG_CACHE_HOME
4fadda1
export instead of env
af1f695
upload artifacts only on request
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
name: Reusable SYCL Linux build and test workflow | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/sycl_linux_build_and_test.yml' | ||
workflow_call: | ||
inputs: | ||
cc: | ||
type: string | ||
required: false | ||
default: "gcc" | ||
cxx: | ||
type: string | ||
required: false | ||
default: "g++" | ||
build_image: | ||
type: string | ||
required: false | ||
default: "ghcr.io/intel/llvm/ubuntu2004_base:latest" | ||
build_runs_on: | ||
type: string | ||
required: false | ||
default: "ubuntu-latest" | ||
build_github_cache: | ||
type: boolean | ||
required: false | ||
default: false | ||
build_cache_root: | ||
type: string | ||
required: true | ||
build_cache_suffix: | ||
type: string | ||
required: false | ||
default: "default" | ||
build_cache_size: | ||
type: string | ||
required: false | ||
default: 2G | ||
build_configure_extra_args: | ||
type: string | ||
required: false | ||
default: "" | ||
build_artifact_suffix: | ||
type: string | ||
required: true | ||
build_upload_artifact: | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
jobs: | ||
configure: | ||
name: Pre-build configuration | ||
runs-on: ubuntu-latest | ||
outputs: | ||
params: ${{ steps.input-parameters.outputs.params }} | ||
steps: | ||
- id: input-parameters | ||
env: | ||
INPUTS: ${{ toJSON(inputs) }} | ||
run: | | ||
if [[ "$GITHUB_EVENT_NAME" != "workflow_call" ]]; then | ||
INPUTS="{ | ||
\"cc\":\"gcc\", | ||
\"cxx\":\"g++\", | ||
\"build_runs_on\":\"sycl-precommit-linux\", | ||
\"build_image\":\"ghcr.io/intel/llvm/ubuntu2004_base:latest\", | ||
\"build_github_cache\":\"false\", | ||
\"build_cache_root\":\"/__w/\", | ||
\"build_cache_suffix\":\"default\", | ||
\"build_cache_size\":\"2G\", | ||
\"build_configure_extra_args\":\"\", | ||
\"build_artifact_suffix\":\"default\", | ||
\"build_upload_artifact\":\"false\" | ||
}" | ||
fi | ||
INPUTS="${INPUTS//'%'/'%25'}" | ||
INPUTS="${INPUTS//$'\n'/'%0A'}" | ||
INPUTS="${INPUTS//$'\r'/'%0D'}" | ||
echo "::set-output name=params::$INPUTS" | ||
echo "$INPUTS" | ||
build: | ||
name: Build SYCL toolchain | ||
needs: configure | ||
runs-on: ${{ fromJSON(needs.configure.outputs.params).build_runs_on }} | ||
container: | ||
image: ${{ fromJSON(needs.configure.outputs.params).build_image }} | ||
options: -u 1001:1001 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: src | ||
- name: Setup Cache | ||
uses: actions/cache@v2 | ||
if: ${{ steps.parameters.build_github_cache }} | ||
id: cache | ||
with: | ||
path: ${{ fromJSON(needs.configure.outputs.params).build_cache_root }}/build_cache_${{ fromJSON(needs.configure.outputs.params).build_cache_suffix }} | ||
key: sycl-build-${{ fromJSON(needs.configure.outputs.params).build_cache_suffix }}-${{ github.sha }} | ||
restore-keys: | | ||
sycl-build-${{ fromJSON(needs.configure.outputs.params).build_cache_suffix }}- | ||
- name: Configure | ||
env: | ||
CC: ${{ fromJSON(needs.configure.outputs.params).cc }} | ||
CXX: ${{ fromJSON(needs.configure.outputs.params).cxx }} | ||
CACHE_ROOT: ${{ fromJSON(needs.configure.outputs.params).build_cache_root }} | ||
CACHE_SUFFIX: ${{ fromJSON(needs.configure.outputs.params).build_cache_suffix }} | ||
CACHE_SIZE: ${{ fromJSON(needs.configure.outputs.params).build_cache_size }} | ||
ARGS: ${{ fromJSON(needs.configure.outputs.params).build_configure_extra_args }} | ||
run: | | ||
mkdir -p $CACHE_ROOT/build_cache_$CACHE_SUFFIX | ||
mkdir -p $GITHUB_WORKSPACE/build | ||
cd $GITHUB_WORKSPACE/build | ||
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ | ||
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \ | ||
--ci-defaults $ARGS --cmake-opt="-DLLVM_CCACHE_BUILD=ON" \ | ||
--cmake-opt="-DLLVM_CCACHE_DIR=$CACHE_ROOT/build_cache_$CACHE_SUFFIX" \ | ||
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE" | ||
- name: Compile | ||
run: cmake --build $GITHUB_WORKSPACE/build | ||
# TODO allow to optionally disable in-tree checks | ||
- name: check-llvm | ||
if: always() | ||
run: | | ||
cmake --build $GITHUB_WORKSPACE/build --target check-llvm | ||
- name: check-clang | ||
if: always() | ||
run: | | ||
export XDG_CACHE_HOME=$GITHUB_WORKSPACE/os_cache | ||
cmake --build $GITHUB_WORKSPACE/build --target check-clang | ||
- name: check-sycl | ||
if: always() | ||
run: | | ||
cmake --build $GITHUB_WORKSPACE/build --target check-sycl | ||
- name: check-llvm-spirv | ||
if: always() | ||
run: | | ||
cmake --build $GITHUB_WORKSPACE/build --target check-llvm-spirv | ||
- name: check-xptifw | ||
if: always() | ||
run: | | ||
cmake --build $GITHUB_WORKSPACE/build --target check-xptifw | ||
- name: Install | ||
if: ${{ steps.parameters.build_upload_artifact }} | ||
run: cmake --build $GITHUB_WORKSPACE/build --target install | ||
- name: Pack | ||
if: ${{ steps.parameters.build_upload_artifact }} | ||
run: tar -czf llvm_sycl.tar.gz -C $GITHUB_WORKSPACE/build/install . | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v1 | ||
if: ${{ steps.parameters.build_upload_artifact }} | ||
with: | ||
name: sycl_linux_${{ fromJSON(needs.configure.outputs.params).build_artifact_suffix }} | ||
path: llvm_sycl.tar.gz | ||
- name: Cleanup | ||
if: always() | ||
run: rm -rf $GITHUB_WORKSPACE/* | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.