Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge pull request #538 from federiconova/feature/add-INR-WLS-plate #374

Merge pull request #538 from federiconova/feature/add-INR-WLS-plate

Merge pull request #538 from federiconova/feature/add-INR-WLS-plate #374

name: Build WCSimRoot
on:
push:
branches: [ develop ]
pull_request_target: #runs on the PR branch, rather than the merge branch. But is required for access to secrets
branches: [ develop ]
release:
concurrency:
#When a PR is pushed too multiple times in a short period, this would usually trigger multiple CI runs
#This setting cancels any in-progress CI when a new push is performed
#But we can have multiple jobs testing different things
# It should be that
# * Each push to a PR cancels any in progress PR CI
# * Each push to develop cancels any in progress develop push-triggered CI
# * It seems that PR merges to develop don't get cancelled. This is actually a good thing
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build_wcsimroot:
runs-on: ubuntu-latest
#This should mean that only one "build" job runs at a time
# Meaning there should be no webpage clashes if multiple CI runs are triggered
# in a short period
concurrency:
group: wcsim_build_wcsimroot
cancel-in-progress: false
defaults:
run:
working-directory: /opt/
#run inside a container that has the prerequisites already installed
container:
image: docker://ghcr.io/hyperk/hk-software:0.0.2
credentials:
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REPO }}
env:
#GIT_COMMIT: ${{ github.sha }}
GIT_PULL_REQUEST: ${{ github.event.number }}
GIT_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GitHubToken: ${{ secrets.VALIDATION_PR }}
ValidationPath: /opt/Validation/
steps:
# Print all the info about the action
- name: Logging
run: |
echo "Test print"
#echo "${{toJSON(github)}}"
- name: Get repo to checkout
id: checkout_repo
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.repo.full_name }}
if_false: ${{ github.repository }}
- name: Get SHA to checkout
id: checkout_sha
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ${{ github.sha }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout WCSim
uses: actions/checkout@v4
with:
ref: ${{ steps.checkout_sha.outputs.value }}
repository: ${{ steps.checkout_repo.outputs.value }}
- name: Install HepMC3
run: |
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum install -y HepMC3 HepMC3-devel HepMC3-search HepMC3-search-devel HepMC3-interfaces-devel HepMC3-doc
- name: Link WCSim directory
run: |
mkdir /opt/WCSim/
ln -s ${GITHUB_WORKSPACE}/ /opt/WCSim/src
# We source hk-pilot in order to get the HK_SYSTEM variable
- name: Setup prerequisites setup script
run: |
cd /opt/
source /usr/local/hk/hk-pilot/setup.sh
echo source /usr/local/hk/hk-pilot/setup.sh >> /opt/setup.sh
echo source /usr/local/hk/ROOT/install-$HK_SYSTEM/setup.sh >> /opt/setup.sh
- name: Build
run: |
source /opt/setup.sh
cd /opt/WCSim
mkdir build install
cd build
cmake ../src \
-D CMAKE_INSTALL_PREFIX=../install \
-D WCSim_WCSimRoot_only=ON
make -j4
make install