diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 7c1fd67..a0c1fac 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -7,15 +7,6 @@ on: required: true type: string -env: - BUILD_DIR: ${{ github.workspace }}/build - INSTALL_DIR: ${{ github.workspace }}/dependencies - - CCACHE_DIR: ${{ github.workspace }}/ccache - CCACHE_MAXSIZE: 10G - - CXX_STANDARD: "20" - jobs: build: @@ -23,105 +14,11 @@ jobs: 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 }} - - - 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_${{ inputs.os }} - 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_${{ inputs.os }} - 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_${{ inputs.os }} - path: | - install.tar.zst - - deploy_to_eos: - if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v') - 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 update - sudo apt-get install -y krb5-user krb5-config - - - uses: actions/download-artifact@v4 - with: - name: deps_${{ inputs.os }} - path: . - - - name: Upload - run: | - echo "$DEPLOY_PWD" | kinit $DEPLOY_USER@CERN.CH 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 $DEPLOY_USER@lxplus.cern.ch:/eos/user/a/atsjenkins/www/ACTS/ci/${{ inputs.os }}/$name - ssh -F ssh_config $DEPLOY_USER@lxplus.cern.ch ln -f -s $name /eos/user/a/atsjenkins/www/ACTS/ci/${{ inputs.os }}/deps.latest.tar.zst + - name: Set up Spack + uses: spack/setup-spack@v2 - - name: Symlink tag - if: startsWith(github.event.ref, 'refs/tags/v') - run: | - echo "$DEPLOY_PWD" | kinit $DEPLOY_USER@CERN.CH 2>&1 >/dev/null - sha=$(echo $GITHUB_SHA | head -c 7) - name=deps.$sha.tar.zst - ssh -F ssh_config $DEPLOY_USER@lxplus.cern.ch ln -f -s $name /eos/user/a/atsjenkins/www/ACTS/ci/${{ inputs.os }}/deps.${{ github.ref_name }}.tar.zst + - run: | + sudo mkdir -p /opt/spack /opt/view + sudo chown $USER /opt/spack + sudo chown $USER /opt/view + - run: spack -e . install --no-check-signature diff --git a/spack.yaml b/spack.yaml new file mode 100644 index 0000000..d7c7a23 --- /dev/null +++ b/spack.yaml @@ -0,0 +1,22 @@ +spack: + view: /opt/view + specs: + - boost@1.85.0 + - cmake@3.30.1 + - edm4hep@0.10.5 + - eigen@3.4.0 + - git-lfs@3.5.1 + - intel-tbb@2021.12.0 + - nlohmann-json@3.11.3 + - podio@1.0.1 + - root@6.32.02~opengl + + config: + install_tree: + root: /opt/spack + padded_length: 128 + + mirrors: + local-buildcache: + url: oci://ghcr.io/acts-project/spack-buildcache + signed: false