ci: set x86_64_v3 target for consistent buildcache #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Spack Buildcache | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 3 * * 0' # Weekly on Sunday at 3am UTC | |
| push: | |
| paths: | |
| - 'test/ci/spack-*.yaml' | |
| - '.github/workflows/buildcache.yml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: github.repository == 'FairRootGroup/FairMQ' | |
| name: ${{ matrix.env }}-gcc-${{ matrix.gcc }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| gcc: ['12', '13', '14', '15'] | |
| env: ['latest'] | |
| include: | |
| - gcc: '15' | |
| env: 'boost187' | |
| env: | |
| GITHUB_USER: ${{ github.actor }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup spack | |
| uses: spack/setup-spack@v2 | |
| with: | |
| ref: v1.1.0 | |
| color: true | |
| buildcache: true | |
| - name: Create environment and login to OCI registry | |
| shell: spack-bash {0} | |
| run: | | |
| spack env create fairmq test/ci/spack-${{ matrix.env }}.yaml | |
| spack -e fairmq mirror set --oci-username ${{ github.actor }} --oci-password-variable GITHUB_TOKEN ghcr-buildcache | |
| - name: Find system compiler | |
| shell: spack-bash {0} | |
| run: spack compiler find | |
| - name: Install GCC | |
| shell: spack-bash {0} | |
| run: | | |
| spack install --fresh gcc@${{ matrix.gcc }} | |
| spack compiler find $(spack location -i gcc@${{ matrix.gcc }}) | |
| - name: Install dependencies | |
| shell: spack-bash {0} | |
| run: | | |
| spack -e fairmq add gcc@${{ matrix.gcc }} | |
| spack -e fairmq config add "packages:all:require:'%gcc@${{ matrix.gcc }}'" | |
| spack -e fairmq install --fail-fast --fresh | |
| - name: Push to buildcache | |
| if: ${{ !cancelled() }} | |
| shell: spack-bash {0} | |
| run: spack -e fairmq buildcache push --unsigned ghcr-buildcache | |
| update-index: | |
| if: github.repository == 'FairRootGroup/FairMQ' && !cancelled() | |
| needs: build | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup spack | |
| uses: spack/setup-spack@v2 | |
| with: | |
| ref: v1.1.0 | |
| color: true | |
| - name: Update buildcache index | |
| shell: spack-bash {0} | |
| run: | | |
| spack env create fairmq test/ci/spack-latest.yaml | |
| spack -e fairmq mirror set --oci-username ${{ github.actor }} --oci-password-variable GITHUB_TOKEN ghcr-buildcache | |
| spack -e fairmq buildcache update-index ghcr-buildcache |