Skip to content

Run build in a single job #365

Run build in a single job

Run build in a single job #365

Workflow file for this run

name: macOS
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_DIR: ${{ github.workspace }}/install
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 10G
CXX_STANDARD: "20"
jobs:
build:
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 }}-
- run: ls -al /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
- name: Initial configure
run: >
cmake -S ${{ github.workspace }}
-B ${{ env.BUILD_DIR }}
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}
-DCMAKE_BUILD_PARALLEL_LEVEL=3
-DCMAKE_CXX_STANDARD=${{ env.CXX_STANDARD }}
- name: Build
run: >
cmake --build ${BUILD_DIR}
- name: Remove .pyc files and tests from install directory
run: |
find ${INSTALL_DIR} -type f -name *.pyc -delete
rm -rf ${INSTALL_DIR}/python/3.12.2/lib/python3.12/test
- name: Package build
run: |
tar czf install.tar.gz -C ${INSTALL_DIR} .
- uses: actions/upload-artifact@v4
with:
name: install
path: |
install.tar.gz
make_tarball:
runs-on: ubuntu-latest # we don't need macOS here
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
name: install
path: .
- name: Unpack full bundle
run: |
mkdir -p ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
rm install.tar.gz
- name: Package merged directory
run: |
tar cf - -C ${INSTALL_DIR} . | zstd -o install.tar.zst -19 -T$(nproc)
- name: Upload merged install directory
uses: actions/upload-artifact@v4
with:
name: deps
path: |
install.tar.zst
deploy_to_eos:
if: github.ref == 'refs/heads/main'
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.zst
echo $name
echo $sha
mv install.tar.zst $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.zst