Spack images #431
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 images | |
| on: | |
| schedule: [ { cron: "50 23 * * 0" } ] # run every Sunday 23h50 | |
| push: { branches: [ main, 'v*' ] } | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| cache: | |
| description: 'Reuse previously cached runs if available' | |
| required: false | |
| default: true | |
| type: boolean | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| step_1_base_2_spackbase: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: { submodules: 'recursive' } | |
| - name: "Build and push 1- base" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/1-base | |
| image-name: base | |
| cache: ${{ github.event_name != 'schedule' && ( github.event_name != 'workflow_dispatch' || inputs.cache ) }} # cache for every run but scheduled ones | |
| - name: "Build and push 2- spackbase" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/2-spackbase | |
| image-name: spackbase | |
| step_3_baselibs: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ['latest', 'oldest'] | |
| compiler: ['gcc', 'clang'] | |
| needs: step_1_base_2_spackbase | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: { submodules: 'recursive' } | |
| - name: "Build and push 3- baselibs" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/3-baselibs | |
| image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-baselibs | |
| build-args: | | |
| VERSION=${{ matrix.version }} | |
| COMPILER=${{ matrix.compiler }} | |
| step_4_mini_5_all: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ['latest', 'oldest'] | |
| compiler: ['gcc', 'clang'] | |
| mpi: ['openmpi','mpich'] | |
| needs: step_3_baselibs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: { submodules: 'recursive' } | |
| - name: "Build and push 4- mini" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/4-mini | |
| image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-${{ matrix.mpi }}-mini | |
| build-args: | | |
| VERSION=${{ matrix.version }} | |
| COMPILER=${{ matrix.compiler }} | |
| MPI=${{ matrix.mpi }} | |
| - name: "Build and push 5- all" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/5-all | |
| image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-${{ matrix.mpi }}-all | |
| build-args: | | |
| VERSION=${{ matrix.version }} | |
| COMPILER=${{ matrix.compiler }} | |
| MPI=${{ matrix.mpi }} | |
| step6_finalize: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ['latest', 'oldest'] | |
| compiler: ['gcc', 'clang'] | |
| mpi: ['openmpi','mpich'] | |
| level: ['mini', 'all'] | |
| needs: step_4_mini_5_all | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: { submodules: 'recursive' } | |
| - name: "Compute tags" | |
| id: info | |
| run: | | |
| if [ 'true' = "${{ github.event_name == 'push' || github.event_name == 'schedule' }}" ] | |
| then | |
| echo "tags=ghcr.io/pdidev/spack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}:${{github.ref_name}}" >> "${GITHUB_OUTPUT}" | |
| echo "fullspack=ghcr.io/pdidev/fullspack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}:${{github.ref_name}}" >> "${GITHUB_OUTPUT}" | |
| fi | |
| - name: "Build and push" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/6-finalize | |
| image-name: spack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }} | |
| test: true | |
| build-args: | | |
| VERSION=${{ matrix.version }} | |
| COMPILER=${{ matrix.compiler }} | |
| MPI=${{ matrix.mpi }} | |
| LIBS=${{ matrix.level }} | |
| tags: | | |
| ${{ steps.info.outputs.tags }} | |
| - name: "Build and push fullspack" | |
| uses: pdidev/test_env/.github/actions/build@v4 | |
| with: | |
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| context: "./" | |
| path: spack/6-finalize | |
| image-name: fullspack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }} | |
| target: fullspack | |
| build-args: | | |
| VERSION=${{ matrix.version }} | |
| COMPILER=${{ matrix.compiler }} | |
| MPI=${{ matrix.mpi }} | |
| LIBS=${{ matrix.level }} | |
| tags: | | |
| ${{ steps.info.outputs.fullspack }} |