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

Restricted x64 CI to relevant changes #2281

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
56 changes: 41 additions & 15 deletions .github/automation/.azure-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /bin/bash

#===============================================================================
# Copyright 2019-2024 Intel Corporation
#
Expand All @@ -16,22 +14,50 @@
# limitations under the License.
#===============================================================================

# Reference:
# https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema

trigger:
- main
- rls-*
batch: true
branches:
include: [ main, rls-* ]
paths:
include:
- .github
- cmake
- examples
- include
- src
- tests
- CMakeLists.txt
exclude:
- src/gpu
- src/cpu/aarch64
- src/cpu/ppc64
- src/cpu/rv64
- src/cpu/s390x

pr:
autoCancel: true
branches:
include: [ main, rls-* ]
paths:
include:
- .github
- cmake
- examples
- include
- src
- tests
- CMakeLists.txt
exclude:
- src/gpu
- src/cpu/aarch64
- src/cpu/ppc64
- src/cpu/rv64
- src/cpu/s390x

jobs:
- job: 'ClangFormat'
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
.github/automation/env/clang.sh 11
displayName: 'init'
- script: |
.github/automation/clang-format.sh
displayName: 'ClangFormat_Check'
failOnStderr: true
- job: 'Ubuntu20'
timeoutInMinutes: 120
pool:
Expand Down
13 changes: 10 additions & 3 deletions .github/automation/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@
# limitations under the License.
#===============================================================================

echo "Using clang-format version: $(clang-format --version)"
CLANG_FORMAT=clang-format-11

echo "Checking ${CLANG_FORMAT}"
if ! ${CLANG_FORMAT} --version; then
echo ${CLANG_FORMAT} is not available or not working correctly.
exit 1
fi

echo "Starting format check..."

for filename in $(find "$(pwd)" -type f | grep -P ".*\.(c|cpp|h|hpp|cl)$"); do clang-format -style=file -i $filename; done
for filename in $(find "$(pwd)" -type f | grep -P ".*\.(c|cpp|h|hpp|cl)$"); do ${CLANG_FORMAT} -style=file -i $filename; done

RETURN_CODE=0
echo $(git status) | grep "nothing to commit" > /dev/null
Expand All @@ -32,4 +39,4 @@ else
echo "Clang-format check PASSED! Not formatted files not found..."
fi

exit ${RETURN_CODE}
exit ${RETURN_CODE}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.
# *******************************************************************************

name: "PR Checks"
name: "PR Linters"

on:
pull_request:
Expand All @@ -31,8 +31,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
commit-message-check:
name: Commit message checker
pr-formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -41,3 +41,7 @@ jobs:
fetch-depth: 0
- name: Check commit messages
run: python3 ./.github/automation/commit-msg-check.py "${{ github.event.pull_request.head.sha }}" "${{ github.event.pull_request.base.sha }}"
- name: Install clang-format
run: sudo apt update && sudo apt install -y "clang-format-11"
- name: Check code formatting
run: .github/automation/clang-format.sh
Loading