Skip to content

Commit

Permalink
[Infrastructure] Add O2 linter (AliceO2Group#7066)
Browse files Browse the repository at this point in the history
Co-authored-by: ALICE Builder <[email protected]>
  • Loading branch information
vkucera and alibuild authored Nov 29, 2024
1 parent 11a1287 commit 8d5e790
Show file tree
Hide file tree
Showing 2 changed files with 1,550 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/o2-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Find issues in O2 code
name: O2 linter

'on': [pull_request, push]
permissions: {}
env:
MAIN_BRANCH: master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
o2-linter:
name: O2 linter
runs-on: ubuntu-24.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to get the full history
- name: Run tests
run: |
# Diff against the common ancestor of the source branch and the main branch.
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...)
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
# shellcheck disable=SC2086 # Ignore unquoted options.
python3 Scripts/o2_linter.py $options "${files[@]}"
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."
Loading

0 comments on commit 8d5e790

Please sign in to comment.