Skip to content

Merge all native platform specific workflows into 1 again #625

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

Merged
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
54 changes: 54 additions & 0 deletions .github/actions/Miscellaneous/Install_Dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Install Dependencies'
description: 'This PR installs the dependencies needed'

runs:
using: composite
steps:

- name: Install dependencies on MacOS
if: runner.os == 'macOS'
shell: bash
run: |
brew update --force
if [[ "$(uname -m)" == "x86_64" ]]; then
brew remove swiftlint
else
brew remove unxip
fi
# workaround for https://github.com/actions/setup-python/issues/577
for pkg in $(brew list | grep '^python@'); do
brew unlink "$pkg"
brew link --overwrite "$pkg"
done
brew upgrade openssl >/dev/null 2>&1
brew upgrade --force
brew install ninja
brew install eigen
brew install boost
brew install gnu-sed
pip install distro pytest

- name: Install dependencies on Linux
if: runner.os == 'Linux'
shell: bash
run: |
# Install deps
sudo apt-get update
sudo apt-get install valgrind ninja-build
sudo apt-get install git g++ debhelper devscripts gnupg python3 doxygen graphviz python3-sphinx
sudo apt-get install -y libc6-dbg
sudo apt-get install valgrind
sudo apt autoremove
sudo apt clean
# Install libraries used by the cppyy test suite
sudo apt install libeigen3-dev
sudo apt install libboost-all-dev


- name: Install dependencies on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
choco install findutils
$env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH"

57 changes: 57 additions & 0 deletions .github/actions/Miscellaneous/Save_PR_Info/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Save PR Info'
description: 'This PR saves the PR Info for the job'

runs:
using: composite
steps:

- name: Save PR Info on Unix Systems
if: ${{ runner.os != 'Windows' }}
shell: bash
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
echo ${{ github.repository }} > ./pr/REPO

cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
if [[ "$cling_on" == "ON" ]]; then
export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-')
export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-')
else
export CLING_HASH="Repl"
# May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x
# which could be quite often for new releases
export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-')
fi

echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV
echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV

- name: Save PR Info on Windows systems
if: runner.os == 'Windows'
shell: powershell
run: |
#can be found
mkdir ./pr
echo "${{ github.event.number }}" > ./pr/NR
echo ${{ github.repository }} > ./pr/REPO

if ( "${{ matrix.cling }}" -imatch "On" )
{
$env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} )
$env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-"
}
else
{
$env:CLING_HASH="Repl"
# May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x
# which could be quite often for new releases
$env:LLVM_HASH_TEMP = (git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x )
$env:LLVM_HASH = $env:LLVM_HASH_TEMP -replace "\t","-"
}

echo "CLING_HASH=$env:CLING_HASH"
echo "LLVM_HASH=$env:LLVM_HASH"

echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV
echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV
23 changes: 23 additions & 0 deletions .github/actions/Miscellaneous/Select_Default_Build_Type/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Select Default Build Type'
description: 'This action selects the default build typose'

runs:
using: composite
steps:
- name: Select default build type of Unix Systems
if: runner.os != 'Windows'
shell: bash
run: |
echo "BUILD_TYPE=Release" >> $GITHUB_ENV
echo "CODE_COVERAGE=0" >> $GITHUB_ENV
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV

- name: Select default build type on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV
echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV
$env:ncpus=$([Environment]::ProcessorCount)
echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV

77 changes: 77 additions & 0 deletions .github/actions/Miscellaneous/Setup_Compiler/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: 'Setup Compiler'
description: 'This PR sets up the compiler for the job'

runs:
using: composite
steps:

- name: Setup Compiler on MacOS
if: runner.os == 'macOS'
shell: bash
run: |
vers="${compiler#*-}"
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
brew install "gcc@$vers"
echo "CC=gcc-${vers}" >> $GITHUB_ENV
echo "CXX=g++-${vers}" >> $GITHUB_ENV
else
brew install llvm@15
if [[ "$(uname -m)" == "x86_64" ]]; then
echo "CC=/usr/local/opt/llvm@15/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/local/opt/llvm@15/bin/clang++" >> $GITHUB_ENV
else
echo "CC=/opt/homebrew/opt/llvm@15/bin/clang" >> $GITHUB_ENV
echo "CXX=/opt/homebrew/opt/llvm@15/bin/clang++" >> $GITHUB_ENV
fi
fi
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
env:
compiler: ${{ matrix.compiler }}

- name: Setup Compiler on Linux
if: runner.os == 'Linux'
shell: bash
run: |
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
vers="${compiler#*-}"
os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`"
if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then
sudo apt install -y gcc-${vers} g++-${vers} lld
echo "CC=gcc-${vers}" >> $GITHUB_ENV
echo "CXX=g++-${vers}" >> $GITHUB_ENV
else
if ! sudo apt install -y clang-${vers}; then
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y clang-${vers}
fi
echo "CC=clang-${vers}" >> $GITHUB_ENV
echo "CXX=clang++-${vers}" >> $GITHUB_ENV
fi
env:
compiler: ${{ matrix.compiler }}

- name: Save Compiler on Windows Systems
if: runner.os == 'Windows'
shell: powershell
run: |
if ( "${{ matrix.compiler }}" -imatch "clang" )
{
$ver="${{ matrix.compiler }}".split("-")[1]
choco install llvm --version=$ver --no-progress -my
clang --version
#
$env:CC="clang"
$env:CXX="clang++"
echo "CC=clang" >> $env:GITHUB_ENV
echo "CXX=clang++" >> $env:GITHUB_ENV
}
elseif ( "${{ matrix.compiler }}" -imatch "msvc" )
{
# MSVC is builtin in container image
}
else
{
echo "Unsupported compiler - fix YAML file"
}
Loading
Loading