Skip to content

Commit

Permalink
Check docker image build on CI (#116)
Browse files Browse the repository at this point in the history
* Make post release fix

* Update build instructions
  • Loading branch information
jorgensd committed May 2, 2024
1 parent b780366 commit 36de714
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
on:
push:
branches:
- "!*"
tags:
- "v*"
pull_request:
branches:
- release
- main

workflow_dispatch:

Expand Down Expand Up @@ -43,6 +45,18 @@ jobs:

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
push: false
file: docker/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ jobs:
uses: jorgensd/actions/install-dolfinx@v0.2.0
with:
petsc_arch: ${PETSC_ARCH}
dolfinx: main

dolfinx: v0.8.0
basix: v0.8.0
ufl: 2024.1.0.post0
ffcx: v0.8.0

- name: Run build-wrapper
run: |
cmake -S ./cpp -B build-mpc
Expand Down
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Main

- No changes

## v0.8.0

- **API**
Expand Down
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ RUN python3 -m pip install meshio

# Copy DOLFINX_MPC source dir
COPY . dolfinx_mpc
RUN python3 -m pip install -U pip setuptools

# Install real mode
RUN . /usr/local/bin/dolfinx-real-mode && \
. /usr/local/dolfinx-real/lib/dolfinx/dolfinx.conf && \
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local/dolfinx-real -DCMAKE_BUILD_TYPE=Developer -B build-dir-real dolfinx_mpc/cpp/ && \
ninja install -j4 -C build-dir-real && \
python3 -m pip install -v --target /usr/local/dolfinx-real/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir dolfinx_mpc/python
python3 -m pip install -v --no-build-isolation --check-build-dependencies \
--target /usr/local/dolfinx-real/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir ./dolfinx_mpc/python

# Clean repo to remove build dir from pip
RUN rm -rf dolfinx_mpc/python/build
Expand All @@ -31,6 +33,7 @@ RUN . /usr/local/bin/dolfinx-complex-mode && \
. /usr/local/dolfinx-complex/lib/dolfinx/dolfinx.conf && \
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local/dolfinx-complex -DCMAKE_BUILD_TYPE=Developer -B build-dir-complex dolfinx_mpc/cpp/ && \
ninja install -j4 -C build-dir-complex && \
python3 -m pip install -v --target /usr/local/dolfinx-complex/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir dolfinx_mpc/python
python3 -m pip install -v --no-build-isolation --check-build-dependencies \
--target /usr/local/dolfinx-complex/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir ./dolfinx_mpc/python

WORKDIR /root

0 comments on commit 36de714

Please sign in to comment.