Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Test PR #362

Closed
Closed
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
24 changes: 17 additions & 7 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,32 @@ permissions:
jobs:
linter:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout PR
uses: actions/checkout@v4
- name: Mount cvmfs
uses: cvmfs-contrib/github-action-cvmfs@v3
- name: Gather paths of needed headers
shell: bash
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Generate compilation database
working-directory: ./SDL
run: |
source setup.sh
pip install compiledb compdb
make BACKEND=cpu -Bnwk > build_log.txt
compiledb < build_log.txt
# This extra step is needed to generate compilation commands for headers
compdb list > compile_commands_new.json
mv compile_commands_new.json > compile_commands.json
# Now we gather some include paths since the compiler is not fully configured to find all the headers.
source setup.sh 1> /dev/null 2> /dev/null
INCLUDE_FLAGS="-I$TRACKLOOPERDIR -I$BOOST_ROOT/include -I$ALPAKA_ROOT/include -I$CUDA_HOME/include -I$ROOT_ROOT/include -I$CMSSW_BASE/src"
INCLUDE_FLAGS="$INCLUDE_FLAGS -I/cvmfs/cms.cern.ch/el8_amd64_gcc11/external/gcc/11.4.1-30ebdc301ebd200f2ae0e3d880258e65/include/c++/11.4.1"
INCLUDE_FLAGS="$INCLUDE_FLAGS -I/cvmfs/cms.cern.ch/el8_amd64_gcc11/external/gcc/11.4.1-30ebdc301ebd200f2ae0e3d880258e65/include/c++/11.4.1/x86_64-redhat-linux-gnu/"
INCLUDE_FLAGS="$INCLUDE_FLAGS -I/cvmfs/cms.cern.ch/el8_amd64_gcc11/external/gcc/11.4.1-30ebdc301ebd200f2ae0e3d880258e65/lib/gcc/x86_64-redhat-linux-gnu/11.4.1/include"
echo "include-flags=$INCLUDE_FLAGS" >> $GITHUB_ENV
# Note: Ideally we would use compiledb to generate a compile_commands.json file, but I couldn't get it to work properly with clang-tidy.
# This alternative of simply passing some extra arguments to clang-tidy seems to work fine (at least for now).
- name: Run linter
uses: cpp-linter/cpp-linter-action@v2
id: linter
Expand All @@ -43,7 +53,7 @@ jobs:
tidy-checks: ''
lines-changed-only: true
ignore: .github|bin|code|data|efficiency
extra-args: '-ferror-limit=0 -std=c++17 -DALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED ${{ env.include-flags }}'
extra-args: '-ferror-limit=0 ${{ env.include-flags }}'
- name: Fail job if there were checks that failed
if: steps.linter.outputs.checks-failed > 0
run: exit 1
run: exit 1
103 changes: 91 additions & 12 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
group: ${{ github.workflow }}-${{ github.event.issue.number }}-${{ contains(github.event.comment.body, '/run standalone') }}-${{ contains(github.event.comment.body, '/run cmssw') }}
cancel-in-progress: true

permissions:
Expand All @@ -17,16 +17,38 @@ jobs:
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '/run standalone') &&
(github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'CONTRIBUTOR')
github.event.comment.user.login == 'ariostas'
runs-on: ubuntu-latest
steps:
- name: Checkout PR
- name: Check out PR
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Get commit SHA
run: |
sha=$(git rev-parse HEAD)
echo "COMMIT_SHA=$sha" >> $GITHUB_ENV
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
skip-token-revoke: true
- name: Create in progress check
uses: LouisBrunner/[email protected]
with:
token: ${{ steps.app-token.outputs.token }}
sha: ${{ env.COMMIT_SHA }}
name: Run Standalone PU200
status: in_progress
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"title": "This check has started...", "summary": "The logs can be found [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."}
- name: Build and run PR
timeout-minutes: 60
id: build-and-run
uses: SegmentLinking/TrackLooper-actions/standalone@v1
uses: SegmentLinkingTests/TrackLooper-actions/standalone@v1
with:
pr-number: ${{ github.event.issue.number }}
- name: Upload plots to archival repo
Expand Down Expand Up @@ -56,20 +78,59 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `There was a problem while building and running in standalone mode. You can find a log of the job [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).`
body: `There was a problem while building and running in standalone mode. The logs can be found [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).`
})
- name: Create App Token
if: always()
uses: actions/create-github-app-token@v1
id: app-token-end
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create completed check
uses: LouisBrunner/[email protected]
if: always()
with:
token: ${{ steps.app-token-end.outputs.token }}
sha: ${{ env.COMMIT_SHA }}
name: Run Standalone PU200
conclusion: ${{ job.status }}
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"title": "Status: ${{ job.status }}", "summary": "The logs can be found [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."}

cmssw:
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '/run cmssw') &&
(github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'CONTRIBUTOR')
github.event.comment.user.login == 'ariostas'
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Get commit SHA
run: |
sha=$(git rev-parse HEAD)
echo "COMMIT_SHA=$sha" >> $GITHUB_ENV
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
skip-token-revoke: true
- name: Create in progress check
uses: LouisBrunner/[email protected]
with:
token: ${{ steps.app-token.outputs.token }}
sha: ${{ env.COMMIT_SHA }}
name: Run CMSSW 21034.1
status: in_progress
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"title": "This check has started...", "summary": "The logs can be found [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."}
- name: Get CMSSW branch name
env:
COMMENT_BODY: ${{ github.event.comment.body }}
Expand All @@ -78,14 +139,13 @@ jobs:
cmssw_branch=
while IFS= read -r line; do
echo "$line"
if [[ $line == *"/run cmssw"* ]]; then
if [[ $line == "/run cmssw"* ]]; then
# Check if there is a branch after "/run cmssw"
words=($line)
cmssw_branch="${words[2]}"
# Validate the extracted branch to avoid code injection
if ! [[ $cmssw_branch =~ ^[[:alnum:]_-]+$ ]]; then
echo "Branch name is invalid. Ignoring..."
cmssw_branch=
if [ -n "$cmssw_branch" ]; then
cmssw_branch=$(git check-ref-format --branch $cmssw_branch || echo "default")
fi
fi
done <<< "$COMMENT_BODY"
Expand All @@ -95,8 +155,9 @@ jobs:
echo "Using CMSSW branch: $cmssw_branch"
echo "cmssw-branch=$cmssw_branch" >> $GITHUB_ENV
- name: Build and run PR
timeout-minutes: 200
id: build-and-run
uses: SegmentLinking/TrackLooper-actions/cmssw@v1
uses: SegmentLinkingTests/TrackLooper-actions/cmssw@v1
with:
pr-number: ${{ github.event.issue.number }}
cmssw-branch: ${{ env.cmssw-branch }}
Expand Down Expand Up @@ -127,5 +188,23 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `There was a problem while building and running with CMSSW. You can find a log of the job [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).`
body: `There was a problem while building and running with CMSSW. The logs can be found [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).`
})
- name: Create App Token
if: always()
uses: actions/create-github-app-token@v1
id: app-token-end
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create completed check
uses: LouisBrunner/[email protected]
if: always()
with:
token: ${{ steps.app-token-end.outputs.token }}
sha: ${{ env.COMMIT_SHA }}
name: Run CMSSW 21034.1
conclusion: ${{ job.status }}
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
output: |
{"title": "Status: ${{ job.status }}", "summary": "The logs can be found [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# TrackLooper

# test

## Quick Start

Expand Down
Loading