Skip to content

ROOT CI

ROOT CI #419

Workflow file for this run

name: 'ROOT CI'
on:
schedule:
- cron: '0 1 * * *'
# https://github.com/root-project/root/pull/12112#issuecomment-1411004278
pull_request:
branches:
- '**'
paths-ignore:
- 'doc/**'
- 'documentation/**'
push:
branches:
- 'master'
- 'v*-*-*-patches'
# Allows nightly builds to trigger one run for each branch easily
workflow_call:
inputs:
head_ref:
type: string
required: true
default: master
base_ref:
type: string
required: true
default: master
incremental:
type: boolean
required: true
default: true
# Enables manual start of workflow
workflow_dispatch:
inputs:
head_ref:
description: rebase from ...
type: string
required: true
default: master
base_ref:
description: ... to ... (can have same value)
type: string
required: true
default: master
incremental:
description: 'Do incremental build'
type: boolean
required: true
default: true
env:
PYTHONUNBUFFERED: true
OS_APPLICATION_CREDENTIAL_ID: '7f5b64a265244623a3a933308569bdba'
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
OS_AUTH_TYPE: 'v3applicationcredential'
OS_AUTH_URL: 'https://keystone.cern.ch/v3'
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: 'public'
OS_REGION_NAME: 'cern'
jobs:
build-macos:
if: github.repository_owner == 'root-project' || github.event_name == 'pull_request'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- platform: mac13
arch: ARM64
config: Release
name: ${{ matrix.platform }} ${{ matrix.arch }} ${{ matrix.config }}
runs-on: # Using '[self-hosted, ..., ...]' does not work for some reason :)
- self-hosted
- macOS
- ${{ matrix.arch }}
- ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pull Request Build
if: github.event_name == 'pull_request'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.platform }}
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.platform }}
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Nightly build
if: github.event_name == 'schedule'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.platform }}
--incremental false
--base_ref ${{ github.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Update artifacts after push to release branch
if: github.event_name == 'push'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.platform }}
--incremental false
--base_ref ${{ github.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}"
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: Test Results ${{ matrix.platform }} ${{ matrix.arch }} ${{ matrix.config }}
path: /tmp/workspace/build/TestResults.xml
build-windows:
if: github.repository_owner == 'root-project' || github.event_name == 'pull_request'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
config: ["Debug", "Release"]
target_arch: [x64, x86]
name: Windows 10 ${{ matrix.target_arch }} ${{ matrix.config }}
runs-on: # Using '[self-hosted, windows, ${{ matrix.arch }}]' does not work for some reason :)
- self-hosted
- windows
- x64 # machine host, not build target
- target${{ matrix.target_arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pull Request Build
if: github.event_name == 'pull_request' && matrix.config == 'Release'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }} "
- name: Workflow dispatch/call
if: github.event_name == 'workflow_dispatch'
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }} "
- name: Nightly build
if: github.event_name == 'schedule'
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental false
--base_ref ${{ github.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }} "
- name: Update artifacts after push to release branch
if: github.event_name == 'push' && matrix.config == 'Release'
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
--incremental false
--base_ref ${{ github.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}
--architecture ${{ matrix.target_arch }} "
build-linux:
if: github.repository_owner == 'root-project' || github.event_name == 'pull_request'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# Specify image + config + (optional) build option overrides
#
# Available images: https://github.com/root-project/root-ci-images
# Common configs: {Release,Debug,RelWithDebInfo)
# Build options: https://root.cern/install/build_from_source/#all-build-options
include:
- image: fedora37
config: Debug
- image: alma8
config: Release
- image: ubuntu20
config: Release
- image: ubuntu2210
config: Release
- image: ubuntu22
config: Debug
overrides: ["imt=Off"]
runs-on:
- self-hosted
- linux
- x64
name: ${{ matrix.image }} ${{ matrix.config }} ${{ join( matrix.overrides, ', ' ) }}
container:
image: registry.cern.ch/root-ci/${{ matrix.image }}:buildready
options: '--security-opt label=disable --rm'
env:
OS_APPLICATION_CREDENTIAL_ID: '7f5b64a265244623a3a933308569bdba'
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
OS_AUTH_TYPE: 'v3applicationcredential'
OS_AUTH_URL: 'https://keystone.cern.ch/v3'
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: 'public'
OS_REGION_NAME: 'cern'
PYTHONUNBUFFERED: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Print debug info
run: 'printf "%s@%s\\n" "$(whoami)" "$(hostname)";
ls -la
'
- name: Apply option overrides from matrix for this job
if: ${{ matrix.overrides != NaN }}
env:
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
FILE: .github/workflows/root-ci-config/buildconfig/${{ matrix.image }}.txt
shell: bash
run: |
set -x
echo '' >> "$FILE"
for ENTRY in $OVERRIDES; do
KEY=$( echo "$ENTRY" | cut -d '=' -f 1 )
# Add entry to file if not exists, otherwise replace
if grep -q "$KEY=" "$FILE"; then
sed -i "s/$KEY=.*\$/$ENTRY/" "$FILE"
else
echo "$ENTRY" >> "$FILE"
fi
done
cat "$FILE" || true
- uses: olemorud/[email protected]
with:
build-directory: /tmp/workspace/src/
- name: Pull Request Build
if: github.event_name == 'pull_request'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.image }}
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.image }}
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Nightly build
if: github.event_name == 'schedule'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.image }}
--incremental false
--base_ref ${{ github.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Update artifacts after push to release branch
if: github.event_name == 'push'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform ${{ matrix.image }}
--incremental false
--base_ref ${{ github.ref_name }}
--repository ${{ github.server_url }}/${{ github.repository }}
"
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: Test Results ${{ matrix.image }} ${{ matrix.config }}
path: /tmp/workspace/build/TestResults.xml
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
sudo: false
# When debugging increase to a suitable value!
timeout-minutes: ${{ github.event.pull_request && 40 || 20 }}
event_file:
if: github.repository_owner == 'root-project' || github.event_name == 'pull_request'
name: "Upload Event Payload"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}