Skip to content

Full CMake based build chain #277

Full CMake based build chain

Full CMake based build chain #277

Workflow file for this run

name: macOS
on: [push, pull_request]
env:
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_DIR: ${{ github.workspace }}/install
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 10G
jobs:
build_python:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-python
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-python
ccache-${{ runner.os }}-${{ github.job }}-
- name: Initial configure
run: cmake -S ${{ github.workspace }} -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_PARALLEL_LEVEL=3
- name: Build
run: >
cmake --build ${BUILD_DIR} -- python
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_1
path: |
build.tar.gz
install.tar.gz
build_tbb:
runs-on: macos-14
needs: [build_python]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-tbb
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-tbb
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_1
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- tbb
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_2
path: |
build.tar.gz
install.tar.gz
build_nlohmann_json:
runs-on: macos-14
needs: [build_tbb]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-nlohmann_json
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-nlohmann_json
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_2
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- nlohmann_json
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_3
path: |
build.tar.gz
install.tar.gz
build_root:
runs-on: macos-14
needs: [build_nlohmann_json]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-root
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-root
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_3
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- root
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_4
path: |
build.tar.gz
install.tar.gz
build_podio_edm4hep:
runs-on: macos-14
needs: [build_root]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-podio
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-podio
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_4
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- podio edm4hep
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_5
path: |
build.tar.gz
install.tar.gz
build_geant4:
runs-on: macos-14
needs: [build_podio_edm4hep]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-geant4
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-geant4
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_5
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- geant4
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_6
path: |
build.tar.gz
install.tar.gz
build_dd4hep:
runs-on: macos-14
needs: [build_geant4]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-dd4hep
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-dd4hep
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_6
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- dd4hep
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_7
path: |
build.tar.gz
install.tar.gz
build_hepmc3:
runs-on: macos-14
needs: [build_dd4hep]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-hepmc3
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-hepmc3
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_7
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- hepmc3
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_8
path: |
build.tar.gz
install.tar.gz
build_pythia8:
runs-on: macos-14
needs: [build_hepmc3]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: ./dependencies.sh
- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-pythia8
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-pythia8
ccache-${{ runner.os }}-${{ github.job }}-
- uses: actions/download-artifact@v4
with:
name: build_8
path: .
- run: |
mkdir ${BUILD_DIR}
tar xf build.tar.gz -C ${BUILD_DIR}
mkdir ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
- name: Build
run: >
cmake --build ${BUILD_DIR} -- hepmc3
- name: Package build
run: |
tar czf build.tar.gz -C ${BUILD_DIR} .
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: build_9
path: |
build.tar.gz
install.tar.gz
make_tarball:
runs-on: ubuntu-latest # we don't need macOS here
needs:
- build_pythia8
steps:
- uses: actions/download-artifact@v4
with:
name: build_9
path: .
- uses: actions/upload-artifact@v4
with:
name: deps
path: |
install.tar.gz
deploy_to_eos:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest # we don't need macOS here
needs:
- make_tarball
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PWD: ${{ secrets.DEPLOY_PWD }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: >
sudo apt-get install -y krb5-user krb5-config
- uses: actions/download-artifact@v4
with:
name: deps
path: .
- name: Upload
run: >
echo "$DEPLOY_PWD" | kinit [email protected] 2>&1 >/dev/null
&& sha=$(echo $GITHUB_SHA | head -c 7)
&& name=deps.$sha.tar.gz
&& mv deps.tar.gz $name
&& scp -F ssh_config $name [email protected]:/eos/user/a/atsjenkins/www/ACTS/ci/macOS/cmake
&& ssh -F ssh_config [email protected] ln -f -s $name /eos/user/a/atsjenkins/www/ACTS/ci/macOS/cmake/deps.latest.tar.gz