diff --git a/.github/docker-compose.yml b/.github/docker-compose.yml index 04f6485..6de5b81 100644 --- a/.github/docker-compose.yml +++ b/.github/docker-compose.yml @@ -19,22 +19,17 @@ services: - .github/:/configs env: - image: "local/env" + image: "ghcr.io/sandialabs/fenix/env" build: - # Generated by spack in a previous workflow step + # Generated by running the bootstrap image dockerfile: .github/spack.Dockerfile - depends_on: - bootstrap: - condition: service_completed_successfully - required: true - pull_policy: build - fenix: image: "local/fenix" build: dockerfile_inline: | - FROM local/env + ARG OMPI_VERSION + FROM ghcr.io/sandialabs/fenix/env:$${OMPI_VERSION} COPY . /fenix RUN . /opt/spack-environment/activate.sh && \ mkdir -p /fenix/build && \ @@ -51,4 +46,6 @@ services: WORKDIR /fenix/build ENTRYPOINT ["/entrypoint.sh"] CMD ["ctest", "--output-on-failure"] + args: + OMPI_VERSION: main pull_policy: build diff --git a/.github/workflows/ci_checks.yaml b/.github/workflows/ci_checks.yaml index 4d9d020..6bb0bf8 100644 --- a/.github/workflows/ci_checks.yaml +++ b/.github/workflows/ci_checks.yaml @@ -11,6 +11,11 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + ompi_version: + - main + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -18,6 +23,13 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Log in to GHCR container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Bake the bootstrap docker image uses: docker/bake-action@v5 with: @@ -25,9 +37,10 @@ jobs: targets: bootstrap workdir: . set: | - *.output=type=docker,name=local/bootstrap - *.cache-from=type=gha,scope=local/bootstrap + *.output=type=docker,name=local/bootstrap/${{ matrix.ompi_version }} + *.cache-from=type=gha,scope=local/bootstrap/${{ matrix.ompi_version }} *.cache-to=type=gha,mode=max,scope=local/bootstrap + *.args.OMPI_VERSION=${{ matrix.ompi_version }} - name: Bootstrap the environment Dockerfile run: docker run -v ${GITHUB_WORKSPACE}/.github:/configs local/bootstrap @@ -36,23 +49,24 @@ jobs: uses: docker/bake-action@v5 with: files: .github/docker-compose.yml - targets: env + targets: ghcr.io/sandialabs/fenix/env workdir: . + pull: true + push: true set: | - *.output=type=docker,name=local/env - *.cache-from=type=gha,scope=local/env - *.cache-to=type=gha,mode=max,scope=local/env + *.cache-from=type=gha,scope=local/env/${{ matrix.ompi_version }} + *.cache-to=type=gha,mode=max,scope=local/env/${{ matrix.ompi_version }} + *.tags=ghcr.io/sandialabs/fenix/env:${{ matrix.ompi_version }} - name: Build Fenix uses: docker/bake-action@v5 with: source: . files: .github/docker-compose.yml - targets: env,fenix + targets: fenix workdir: . set: | - *.output=type=docker,name=local/fenix - *.cache-from=type=gha,scope=local/env + *.args.OMPI_VERSION=${{ matrix.ompi_version }} - name: Test Fenix run: docker run local/fenix