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

Added git CI #106

Merged
merged 7 commits into from
Nov 18, 2021
Merged
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
74 changes: 74 additions & 0 deletions .github/workflows/github_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#####################################################################
# This triggers git Continuous Integration tests when a PR to #
# any branch is made. Or if a code-commit is made to any #
# test branch (temporarily) specified below. #
# #
# The tests themselves are delegated to a gitlab CI runner #
# controlled by the .gitlab-ci.yml file at #
# https://gitlab.cern.ch/cms-l1tk/cmssw_CI . #
# N.B. .gitlab-ci.yml must be update if the CMSSW version changes. #
# #
# Communication between the github & gitlab CIs is done via scripts #
# at https://github.com/cms-L1TK/gitlab-mirror-and-ci-action #
#####################################################################

name: PR validation with GitLab CI

on: # Controls when the action will run.
workflow_dispatch:
push: # Please specify your branch down here if you want CI to run for each push to it.
branches: [myBranchUnderTest]
pull_request: # Run CI if someone makes a PR to any branch
# branches: [L1TK-dev-12_0_0_pre4] # Optionally only run CI if PR is to this branch.

env:
mirror_repo: "https://gitlab.cern.ch/cms-l1tk/cmssw_CI" # gitlab mirror
current_branch: "unitialized"

jobs:
trigger_gitlab_CI: # https://github.com/marketplace/actions/mirror-to-gitlab-and-run-gitlab-ci
name: trigger_gitlab_CI
runs-on: ubuntu-latest
steps:

- name: DebugPrint
run: |
echo "github.ref = ${{ github.ref }}"

- name: Redefine branch on pull_request
if: github.event_name == 'pull_request'
run: |
# Sets env. variable $current_branch
echo "current_branch=$(echo ${{ github.head_ref }})" >> $GITHUB_ENV

- name: Redefine branch on push
if: github.event_name == 'push'
run: |
# Sets env. variable $current_branch
echo "current_branch=$(echo ${{ github.ref }} | sed -E 's|refs/[a-zA-Z]+/||')" >> $GITHUB_ENV

- name: Trigger gitlab CI run
# Communicate between gitlab & github, and trigger gitlab CI run.
# (Forked from https://github.com/SvanBoxel/gitlab-mirror-and-ci-action).
uses: cms-L1TK/gitlab-mirror-and-ci-action@master
env:
GITLAB_HOSTNAME: "gitlab.cern.ch"
GITLAB_USERNAME: "cms-l1tk"
GITLAB_PASSWORD: ${{ secrets.GITLAB_L1TK_CMSSW_CI_TOKEN }} # Generate token here: https://gitlab.cern.ch/cms-l1tk/cmssw_CI/-/settings/access_tokens and add it to GitHub secrets https://github.com/cms-L1TK/cmssw/settings/secrets/actions
GITLAB_PROJECT_ID: "124851" # ID visible at https://gitlab.cern.ch/cms-l1tk/cmssw
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret
MIRROR_REPO: ${{ env.mirror_repo }} # gitlab mirror.
IS_CMSSW: "true" # Is repo CMSSW or something else (e.g. HLS)?
CHECKOUT_BRANCH: ${{ env.current_branch }} # Needed so push to gitlab can work
REMOVE_BRANCH: "true" # Refreshes branch on mirror, which triggers CI run there.
REBASE_MASTER: "false" # If true would rebase to "master", which isn't used in cms-L1TK.
RETURN_FILE: "pipeline_url.txt" # Output file with gitlab pipeline url

- name: print summary
if: always()
run: |
echo ""
echo "==========================================================="
echo "DETAILED OUTPUT FROM CMSSW COMPILATION & RUN AVAILABLE "
echo "AT FOLLOWING GITLAB CI URL:"
cat pipeline_url.txt
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTracklet/test/makeHists.csh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
###########################################################################

if ($#argv == 0) then
set inputFullFileName = "TTbar_PU200_D49.root"
set inputFullFileName = "TTbar_PU200_D76.root"
else
set inputFullFileName = $1
endif
Expand Down
73 changes: 73 additions & 0 deletions L1Trigger/TrackFindingTracklet/test/skimForCI_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#-----------------------------------------------------------
# This job skims a MC dataset, selecting only products
# that are needed to run the L1 tracking & measure its
# performance.
#
# It is typically used to create small datasets that
# the git CI runs on to check new code.
#
# Whenever the L1 tracking group switches to a new default
# MC dataset, this skim should be run on ttbar+0PU MC,
# and the skimmed dataset placed in
# https://gitlab.cern.ch/cms-l1tk/cmssw_CI .
#-----------------------------------------------------------

############################################################
# define basic process
############################################################

import FWCore.ParameterSet.Config as cms
import FWCore.Utilities.FileUtils as FileUtils
import os
process = cms.Process("SKIM")


############################################################
# import standard configurations
############################################################

process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')

# D49 geometry (T15 tracker)
process.load('Configuration.Geometry.GeometryExtended2026D76Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026D76_cff')

process.load('Configuration.StandardSequences.EndOfProcess_cff')


process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1000))

#--- To use MCsamples scripts, defining functions get*data*() for easy MC access,
#--- follow instructions in https://github.com/cms-L1TK/MCsamples

from MCsamples.Scripts.getCMSdata_cfi import *

# Read data from card files (defines getCMSdataFromCards()):
from MCsamples.RelVal_1130_D76.PU0_TTbar_14TeV_cfi import *
inputMC = getCMSdataFromCards()

process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputMC))

process.output = cms.OutputModule("PoolOutputModule",
splitLevel = cms.untracked.int32(0),
eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
outputCommands = cms.untracked.vstring('drop *'),
fileName = cms.untracked.string('/tmp/skimmedForCI.root'),
dataset = cms.untracked.PSet(
filterName = cms.untracked.string(''),
dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW')
)
)

process.output.outputCommands.append('keep *_*_*Level1TTTracks*_*')
process.output.outputCommands.append('keep *_*_*StubAccepted*_*')
process.output.outputCommands.append('keep *_*_*ClusterAccepted*_*')
process.output.outputCommands.append('keep *_*_*MergedTrackTruth*_*')
process.output.outputCommands.append('keep *_genParticles_*_*')

process.pd = cms.EndPath(process.output)

process.schedule = cms.Schedule(process.pd)