mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-12-14 06:50:17 +00:00
ci: deduplicate buildcache workflow using setup-deps action
This commit is contained in:
6
.github/actions/setup-deps/action.yml
vendored
6
.github/actions/setup-deps/action.yml
vendored
@@ -22,10 +22,14 @@ runs:
|
|||||||
color: true
|
color: true
|
||||||
buildcache: true
|
buildcache: true
|
||||||
|
|
||||||
|
- name: Find system compiler
|
||||||
|
shell: spack-bash {0}
|
||||||
|
run: spack compiler find
|
||||||
|
|
||||||
- name: Install GCC
|
- name: Install GCC
|
||||||
shell: spack-bash {0}
|
shell: spack-bash {0}
|
||||||
run: |
|
run: |
|
||||||
spack install gcc@${{ inputs.gcc }}
|
spack install ${{ inputs.fresh == 'true' && '--fresh' || '' }} gcc@${{ inputs.gcc }} target=x86_64_v3
|
||||||
spack compiler find $(spack location -i gcc@${{ inputs.gcc }})
|
spack compiler find $(spack location -i gcc@${{ inputs.gcc }})
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
42
.github/workflows/buildcache.yml
vendored
42
.github/workflows/buildcache.yml
vendored
@@ -29,47 +29,23 @@ jobs:
|
|||||||
- gcc: '15'
|
- gcc: '15'
|
||||||
env: 'boost187'
|
env: 'boost187'
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_USER: ${{ github.actor }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup spack
|
- uses: ./.github/actions/setup-deps
|
||||||
uses: spack/setup-spack@v2
|
|
||||||
with:
|
with:
|
||||||
ref: v1.1.0
|
gcc: ${{ matrix.gcc }}
|
||||||
color: true
|
env: ${{ matrix.env }}
|
||||||
buildcache: true
|
fresh: '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
|
- name: Push to buildcache
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
shell: spack-bash {0}
|
shell: spack-bash {0}
|
||||||
run: spack -e fairmq buildcache push --unsigned ghcr-buildcache
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
spack -e fairmq mirror set --oci-username ${{ github.actor }} --oci-password-variable GITHUB_TOKEN ghcr-buildcache
|
||||||
|
spack -e fairmq buildcache push --unsigned ghcr-buildcache
|
||||||
|
|
||||||
update-index:
|
update-index:
|
||||||
if: github.repository == 'FairRootGroup/FairMQ' && !cancelled()
|
if: github.repository == 'FairRootGroup/FairMQ' && !cancelled()
|
||||||
|
|||||||
Reference in New Issue
Block a user