Skip to content

Commit

Permalink
Get FEniCSx refs from central workflow (#3537)
Browse files Browse the repository at this point in the history
* Try getting fenicsx refs from central workflow.

* Fix.

* Fix.

* Fix.

* Fix.

* Fix.

* Use default behaviour for DOLFINx checkout.

* Fix.

* Rollout through ccpp

* Rollout across all workflows.

* Fix?

* Fix.

* Fix sonarcloud.

* Fix up.

* Fix.
  • Loading branch information
jhale authored Nov 26, 2024
1 parent 070a2cd commit 5847cfa
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 31 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ on:
type: string

jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
- name: Checkout DOLFINx
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -75,7 +79,7 @@ jobs:
build:
runs-on: ubuntu-latest
needs: lint
needs: [fenicsx-refs, lint]
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
Expand All @@ -102,9 +106,9 @@ jobs:
- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
run: |
pip install git+https://github.com/FEniCS/ufl.git
pip install git+https://github.com/FEniCS/basix.git
pip install git+https://github.com/FEniCS/ffcx.git
pip install git+https://github.com/fenics/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
pip install git+https://github.com/fenics/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
pip install git+https://github.com/fenics/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
- name: Install FEniCS Python components
if: github.event_name == 'workflow_dispatch'
run: |
Expand Down Expand Up @@ -148,7 +152,7 @@ jobs:

build-with-petsc:
runs-on: ubuntu-latest
needs: lint
needs: [fenicsx-refs, lint]
strategy:
matrix:
petsc_arch: [linux-gnu-real32-32, linux-gnu-real64-32, linux-gnu-complex64-32, linux-gnu-complex128-32, linux-gnu-real64-64, linux-gnu-complex128-64]
Expand All @@ -172,9 +176,9 @@ jobs:
- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
run: |
pip install git+https://github.com/FEniCS/ufl.git
pip install git+https://github.com/FEniCS/basix.git
pip install git+https://github.com/FEniCS/ffcx.git
pip install git+https://github.com/FEniCS/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
pip install git+https://github.com/FEniCS/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
pip install git+https://github.com/FEniCS/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
- name: Install FEniCS Python components
if: github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -236,6 +240,7 @@ jobs:

build-and-publish-docs:
runs-on: ubuntu-latest
needs: [fenicsx-refs, lint]
container: "ghcr.io/fenics/test-env:current-openmpi"
env:
PETSC_ARCH: linux-gnu-real64-32
Expand All @@ -250,9 +255,9 @@ jobs:
- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
run: |
pip install git+https://github.com/FEniCS/ufl.git
pip install git+https://github.com/FEniCS/basix.git
pip install git+https://github.com/FEniCS/ffcx.git
pip install git+https://github.com/FEniCS/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
pip install git+https://github.com/FEniCS/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
pip install git+https://github.com/FEniCS/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
- name: Install FEniCS Python components
if: github.event_name == 'workflow_dispatch'
run: |
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/fenicsx-refs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Set FEniCSx component git refs

# Developers can set these refs to propagate a consistent set of git refs
# across all workflows

on:
workflow_call:
outputs:
basix_ref:
value: ${{ jobs.fenicsx-refs.outputs.basix_ref }}
ufl_ref:
value: ${{ jobs.fenicsx-refs.outputs.ufl_ref }}
ffcx_ref:
value: ${{ jobs.fenicsx-refs.outputs.ffcx_ref }}

jobs:
fenicsx-refs:
name: Set FEniCSx component git refs
runs-on: ubuntu-latest

outputs:
basix_ref: ${{ steps.fenicsx-refs.outputs.basix_ref }}
ufl_ref: ${{ steps.fenicsx-refs.outputs.ufl_ref }}
ffcx_ref: ${{ steps.fenicsx-refs.outputs.ffcx_ref }}

# Make necessary changes to right side of equality
steps:
- name: Set FEniCSx component git refs
id: fenicsx-refs
run: |
echo "basix_ref=main" >> $GITHUB_OUTPUT
echo "ufl_ref=main" >> $GITHUB_OUTPUT
echo "ffcx_ref=main" >> $GITHUB_OUTPUT
10 changes: 7 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ on:
workflow_dispatch:

jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

mac-os-build:
name: macOS Homebrew install and test
runs-on: macos-14
needs: fenicsx-refs
env:
PETSC_ARCH: arch-darwin-c-opt
PETSC_DIR: ${{ github.workspace }}/petsc
Expand Down Expand Up @@ -63,9 +67,9 @@ jobs:
- name: Install FEniCSx dependencies
run: |
python -m pip install git+https://github.com/FEniCS/basix.git
python -m pip install git+https://github.com/FEniCS/ufl.git
python -m pip install git+https://github.com/FEniCS/ffcx.git
python -m pip install git+https://github.com/fenics/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
python -m pip install git+https://github.com/fenics/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
python -m pip install git+https://github.com/fenics/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
- uses: actions/checkout@v4
with:
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/oneapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ on:
workflow_dispatch:

jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

build:
runs-on: ubuntu-latest
needs: fenicsx-refs
container: ubuntu:24.04

env:
Expand Down Expand Up @@ -52,15 +56,16 @@ jobs:
conda list
- name: Install Basix
run: pip install --no-build-isolation git+https://github.com/FEniCS/basix.git
run: pip install --no-build-isolation git+https://github.com/FEniCS/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}

- name: Clone FFCx
uses: actions/checkout@v4
with:
path: ./ffcx
repository: FEniCS/ffcx
ref: main
- name: Install FFCx C interface
ref: ${{ needs.fenicsx-refs.outputs.ffcx_ref }}

- name: Install UFCx C interface
run: |
cmake -G Ninja -B ufcx-build-dir -S ffcx/cmake/
cmake --build ufcx-build-dir
Expand All @@ -77,7 +82,7 @@ jobs:
- name: Install UFL and FFCx modules
run: |
pip install --no-build-isolation git+https://github.com/FEniCS/ufl.git
pip install --no-build-isolation git+https://github.com/FEniCS/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
pip install --no-build-isolation ffcx/
- name: Build and run DOLFINx C++ unit tests (serial and MPI)
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pyvista.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ on:
workflow_dispatch: ~

jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

pyvista:
if: "!(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
runs-on: ubuntu-latest
needs: fenicsx-refs
container: ghcr.io/fenics/test-env:current-openmpi

env:
Expand All @@ -30,17 +33,16 @@ jobs:

strategy:
matrix:
# petsc_arch: [real, complex]
petsc_arch: [linux-gnu-real64-32, linux-gnu-complex128-32]

steps:
- uses: actions/checkout@v4

- name: Install FEniCS Python components
run: |
pip install git+https://github.com/FEniCS/ufl.git
pip install git+https://github.com/FEniCS/basix.git
pip install git+https://github.com/FEniCS/ffcx.git
python -m pip install git+https://github.com/fenics/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
python -m pip install git+https://github.com/fenics/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
python -m pip install git+https://github.com/fenics/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
apt-get update
apt-get install -y --no-install-recommends libgl1-mesa-dev xvfb # pyvista
apt-get install -y --no-install-recommends libqt5gui5t64 libgl1 # pyvistaqt
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ on:
workflow_dispatch:

jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

build:
runs-on: ubuntu-latest
needs: fenicsx-refs
container: fenicsproject/test-env:current-redhat

name: Rocky build and test
Expand All @@ -30,9 +34,9 @@ jobs:
- name: Install FEniCS Python components
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
python3 -m pip install git+https://github.com/fenics/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
python3 -m pip install git+https://github.com/fenics/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
python3 -m pip install git+https://github.com/fenics/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
- name: Configure C++
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ on:


jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

build:
name: Build
runs-on: ubuntu-latest
needs: fenicsx-refs
if: (github.event.pull_request.head.repo.full_name == github.repository) || github.ref_name == 'main'
container: fenicsproject/test-env:current-mpich
env:
Expand Down Expand Up @@ -58,9 +62,9 @@ jobs:
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Install FEniCS Python components
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
python -m pip install git+https://github.com/fenics/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}
python -m pip install git+https://github.com/fenics/basix.git@${{ needs.fenicsx-refs.outputs.basix_ref }}
python -m pip install git+https://github.com/fenics/ffcx.git@${{ needs.fenicsx-refs.outputs.ffcx_ref }}
- name: Run build-wrapper
run: |
mkdir build
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ on:
workflow_dispatch:

jobs:
fenicsx-refs:
uses: ./.github/workflows/fenicsx-refs.yml

windows-build:
name: Windows vcpkg build
runs-on: windows-latest
needs: fenicsx-refs
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

Expand All @@ -35,13 +39,14 @@ jobs:
python-version: "3.12"

- name: Install UFL
run: pip install git+https://github.com/FEniCS/ufl.git
run: pip install git+https://github.com/FEniCS/ufl.git@${{ needs.fenicsx-refs.outputs.ufl_ref }}

- name: Checkout Basix
uses: actions/checkout@v4
with:
repository: "fenics/basix"
path: basix
ref: ${{ needs.fenicsx-refs.outputs.basix_ref }}

- name: Insert add_dll_directory calls into Basix
working-directory: basix/python/basix
Expand Down Expand Up @@ -74,6 +79,7 @@ jobs:
with:
repository: "fenics/ffcx"
path: ffcx
ref: ${{ needs.fenicsx-refs.outputs.ffcx_ref }}

- name: Install UFCx header
working-directory: ffcx
Expand Down

0 comments on commit 5847cfa

Please sign in to comment.