Skip to content

Commit

Permalink
Add a pip install --no-build-isolation test (#741)
Browse files Browse the repository at this point in the history
* Test isolated build

* Test pip install

* Add package

* Add new test

* Update CI name

* Fix typo

* Update actions file

* Simplify

* Updates

* Update for sonarcloud

* Simplify readme

* Update

* Undo FFCx CI changes

* Updates

* Simplify

* Bump Python version in CI

* Test change

* Updates

* Undo change

* Bump version

* Updates

* Formatting updates

* Simplify
  • Loading branch information
garth-wells authored Nov 18, 2023
1 parent 6abbfb5 commit d11d807
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 147 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/dolfinx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Basix
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build-dir -S ./cpp
cmake --build build-dir
cmake --install build-dir
python3 -m pip install ./python
- name: Install FEniCS Python components
if: github.event_name != 'workflow_dispatch'
run: |
Expand All @@ -55,17 +54,16 @@ jobs:
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_branch }}
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_branch }}
- name: Get DOLFINx
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./dolfinx
repository: FEniCS/dolfinx
ref: main
- name: Get DOLFINx
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./dolfinx
repository: FEniCS/dolfinx
Expand All @@ -79,12 +77,10 @@ jobs:
run: |
python3 -m pip install -r dolfinx/python/build-requirements.txt # TO REMOVE
python3 -m pip -v install --check-build-dependencies --no-build-isolation dolfinx/python/
- name: Run mypy checks
run: |
cd dolfinx/python
python3 -m mypy dolfinx
- name: Build DOLFINx C++ unit tests
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S dolfinx/cpp/test/
Expand All @@ -93,12 +89,10 @@ jobs:
run: |
cd build/test
ctest -V --output-on-failure -R unittests
- name: Run DOLFINx Python unit tests
run: |
cd dolfinx
python3 -m pytest -n auto python/test/unit
- name: Run DOLFINx Python demos
run: |
cd dolfinx/
Expand Down
27 changes: 9 additions & 18 deletions .github/workflows/ffcx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,37 @@ jobs:
build:
name: Run FFCx tests
runs-on: ubuntu-latest
env:
CC: gcc-10
CXX: g++-10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

python-version: '3.11'
- name: Install dependencies
run: sudo apt-get install -y libopenblas-dev liblapack-dev graphviz libgraphviz-dev ninja-build

- name: Install UFL (default branch)
if: github.event_name != 'workflow_dispatch'
run: python3 -m pip install git+https://github.com/FEniCS/ufl.git
run: pip install git+https://github.com/FEniCS/ufl.git
- name: Install UFL (specified branch)
if: github.event_name == 'workflow_dispatch'
run: python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_branch }}

run: pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_branch }}
- name: Install Basix
run: python3 -m pip -v install .[ci]

run: pip -v install .[ci]
- name: Get FFCx source (default branch)
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./ffcx
repository: FEniCS/ffcx
ref: main
- name: Get FFCx source (specified branch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./ffcx
repository: FEniCS/ffcx
ref: ${{ github.event.inputs.ffcx_branch }}

- name: Install FFCx
run: python3 -m pip install ./ffcx[ci]
run: pip install ./ffcx[ci]
- name: Run FFCx tests
run: python3 -m pytest -n auto ffcx/test
run: pytest -n auto --ignore=ffcx/test/test_lnodes.py ffcx/test
12 changes: 2 additions & 10 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,35 @@ on:
jobs:
build:
name: Build and test (oneAPI)
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
container: ubuntu:22.04 # Run in container to test with minimal pre-installed packages

env:
CC: icx
CXX: icpx
DEBIAN_FRONTEND: noninteractive

steps:
- name: Install required packages to install Intel compilers and to build
run: apt -y update && apt install -y bzip2 cmake git gnupg ninja-build wget

- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Install Intel compilers and Intel Python
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list
apt update
apt install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl intel-oneapi-python libstdc++-11-dev
- name: Install Basix
run: |
. /opt/intel/oneapi/setvars.sh
pip -v install .[test]
- name: Run units tests
run: |
. /opt/intel/oneapi/setvars.sh
pip install pytest-xdist
pytest -n auto --durations 20 test/
- name: Run Python demos
run: |
. /opt/intel/oneapi/setvars.sh
pytest demo/python/test.py
- name: Run C++ demos
run: |
. /opt/intel/oneapi/setvars.sh
Expand Down
24 changes: 7 additions & 17 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,22 @@ on:
jobs:
build:
name: Build and test (MacOS)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]

runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies (non-Python)
run: brew install ninja

- name: Install Basix
run: |
python -m pip -v install .[test]
run: pip -v install .[test]
- name: Run units tests
run: |
python -m pip install pytest-xdist
python -m pytest -n auto --durations 20 test/
pip install pytest-xdist
pytest -n auto --durations 20 test/
- name: Run python demos
run: python -m pytest demo/python/test.py

run: pytest demo/python/test.py
- name: Run C++ demos
run: |
python -m pytest demo/cpp/test.py
run: pytest demo/cpp/test.py
Loading

0 comments on commit d11d807

Please sign in to comment.