forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added git CI * Run CI on PR to any branch * Make L1TRKALGO configurable * tweak * Added script to skim MC datasets for git CI * Remove L1TRKALGO option * Gave CI more sensible name
- Loading branch information
Showing
3 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |