Skip to content

Commit 8ff653a

Browse files
jhaleclaude
andcommitted
Add fenicsx-refs.env and use it in CI workflows to pin dependency refs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 30b2403 commit 8ff653a

3 files changed

Lines changed: 21 additions & 37 deletions

File tree

.github/workflows/dolfinx-tests.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@ on:
88
merge_group:
99
branches: [main]
1010
workflow_dispatch:
11-
inputs:
12-
dolfinx_ref:
13-
description: "DOLFINx branch or tag"
14-
default: "main"
15-
type: string
16-
basix_ref:
17-
description: "Basix branch or tag"
18-
default: "main"
19-
type: string
20-
ufl_ref:
21-
description: "UFL branch or tag"
22-
default: "main"
23-
type: string
2411
# Weekly build on Mondays at 8 am
2512
schedule:
2613
- cron: "0 8 * * 1"
@@ -38,33 +25,21 @@ jobs:
3825
OMPI_MCA_rmaps_base_oversubscribe: true # Older OpenMPI
3926
steps:
4027
- uses: actions/checkout@v6
41-
- name: Install UFL and Basix (default branches/tags)
42-
if: github.event_name != 'workflow_dispatch'
28+
- name: Load environment variables
29+
run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV
30+
- name: Install UFL and Basix
4331
run: |
44-
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ufl.git
45-
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git
46-
- name: Install UFL and Basix (specified branches/tags)
47-
if: github.event_name == 'workflow_dispatch'
48-
run: |
49-
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_ref }}
50-
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
32+
python3 -m pip install --break-system-packages git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
33+
python3 -m pip install --break-system-packages git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
5134
- name: Install FFCx
5235
run: |
5336
pip3 install --break-system-packages .
54-
- name: Get DOLFINx source (default branch/tag)
55-
if: github.event_name != 'workflow_dispatch'
56-
uses: actions/checkout@v6
57-
with:
58-
path: ./dolfinx
59-
repository: FEniCS/dolfinx
60-
ref: main
61-
- name: Get DOLFINx source (specified branch/tag)
62-
if: github.event_name == 'workflow_dispatch'
37+
- name: Get DOLFINx source
6338
uses: actions/checkout@v6
6439
with:
6540
path: ./dolfinx
66-
repository: FEniCS/dolfinx
67-
ref: ${{ github.event.inputs.dolfinx_ref }}
41+
repository: ${{ env.dolfinx_repository }}
42+
ref: ${{ env.dolfinx_ref }}
6843
- name: Install DOLFINx (C++)
6944
run: |
7045
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -DBUILD_TESTING=true -B build -S dolfinx/cpp/

.github/workflows/fenicsx-refs.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ufl_repository=FEniCS/ufl
2+
ufl_ref=main
3+
basix_repository=FEniCS/basix
4+
basix_ref=main
5+
dolfinx_repository=FEniCS/dolfinx
6+
dolfinx_ref=main

.github/workflows/pythonapp.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
- name: Checkout FFCx
3333
uses: actions/checkout@v6
3434

35+
- name: Load environment variables
36+
run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV
37+
3538
- name: Set up Python
3639
uses: actions/setup-python@v6
3740
with:
@@ -62,16 +65,16 @@ jobs:
6265
- name: Install FEniCS dependencies (Python, Unix)
6366
if: runner.os == 'Linux' || runner.os == 'macOS'
6467
run: |
65-
pip install git+https://github.com/FEniCS/ufl.git
66-
pip install git+https://github.com/FEniCS/basix.git
68+
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
69+
pip install git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }}
6770
6871
- name: Install FEniCS dependencies (Python, Windows)
6972
if: runner.os == 'Windows'
7073
env:
7174
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
7275
run: |
73-
pip install git+https://github.com/FEniCS/ufl.git
74-
pip install -v git+https://github.com/FEniCS/basix.git --config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
76+
pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }}
77+
pip install -v git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} --config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
7578
7679
- name: Install FFCx (Linux, with optional dependencies)
7780
if: runner.os == 'Linux'

0 commit comments

Comments
 (0)