Skip to content

Commit 8d5e790

Browse files
vkuceraalibuild
andauthored
[Infrastructure] Add O2 linter (#7066)
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 11a1287 commit 8d5e790

File tree

2 files changed

+1550
-0
lines changed

2 files changed

+1550
-0
lines changed

.github/workflows/o2-linter.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# Find issues in O2 code
3+
name: O2 linter
4+
5+
'on': [pull_request, push]
6+
permissions: {}
7+
env:
8+
MAIN_BRANCH: master
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
o2-linter:
16+
name: O2 linter
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # needed to get the full history
23+
- name: Run tests
24+
run: |
25+
# Diff against the common ancestor of the source branch and the main branch.
26+
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...)
27+
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
28+
# shellcheck disable=SC2086 # Ignore unquoted options.
29+
python3 Scripts/o2_linter.py $options "${files[@]}"
30+
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."

0 commit comments

Comments
 (0)