Build and test UEDGE - write wheel files if tests pass #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test UEDGE - write wheel files if tests pass | |
on: [push, pull_request] | |
jobs: | |
run-all-tests: | |
if: false | |
name: Runs test ${{ matrix.tests }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.9] | |
tests: [fulltests, unittests/D+C, unittests/D_mols, unittests/D_only, unittests/slab_D_only] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pip dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install forthon mppl numpy h5py | |
python -m pip install flake8 | |
python -m pip install pytest-isolate pytest-xdist | |
- name: Build UEDGE | |
run: | | |
pip install . | |
- name: Return to pytests branch | |
uses: actions/checkout@v4 | |
with: | |
ref: pytests-develop | |
repository: LLNL/UEDGE | |
- name: Test with pytest | |
run: | | |
# Create a clean UEDGE instance for every test | |
pytest --isolate --tb=native pytests/${{ matrix.tests }} | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} for Python ${{ matrix.pyversions }} | |
# needs: run-all-tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13] #, macos-12, ubuntu-20.04] | |
# pyversions: ['3.11'] #, '3.10', '3.9', '3.8', '3.7',] | |
steps: | |
- uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v5 | |
# with: | |
# python-version: ${{ matrix.pyversions }} | |
# - name: Install pip dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# python -m pip install forthon mppl numpy h5py | |
# python -m pip install flake8 | |
# python -m pip install pytest-isolate pytest-xdist | |
# pip install 'build<0.10.0' | |
- name: Symlink gfortran for macOS | |
if: runner.os == 'macOS' | |
run: | | |
# make sure gfortran is available | |
ln -s /usr/local/bin/gfortran-13 /usr/local/bin/gfortran | |
gfortran --version | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BEFORE_BUILD: pip install numpy, forthon, 'build<0.10.0' | |
# - name: Build wheels | |
# run: python -m build | |
# - name: Upload Linux wheels | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ matrix.os }}-${{ matrix.pyversions }} | |
# path: dist/*.whl | |
# - name: Delocate macOS wheels | |
# if: runner.os == 'macOS' | |
# run: | | |
# pip install delocate | |
# mkdir delocated_wheels | |
# delocate-wheel -w delocated_wheels dist/*.whl | |
# - name: Delocate Linux wheels | |
# if: runner.os == 'Linux' | |
# run: | | |
# pip install auditwheel | |
# cd dist | |
# auditwheel repair *.whl | |
# - name: Upload maxOS wheels | |
# if: runner.os == 'macOS' | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ matrix.os }}-${{ matrix.pyversions }} | |
# path: delocated_wheels/*.whl | |
# - name: Upload Linux wheels | |
# if: runner.os == 'Linux' | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ matrix.os }}-${{ matrix.pyversions }} | |
# path: wheelhouse/*.whl | |
build_arm_wheels: | |
name: Build wheels on ${{ matrix.os }} for Python ${{ matrix.pyversions }} | |
if: false | |
runs-on: ${{ matrix.os }} | |
needs: run-all-tests | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-14] #, macos-13-arm64] | |
pyversions: ['3.11', '3.10'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pyversions }} | |
- name: Install pip dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install forthon mppl numpy h5py | |
python -m pip install flake8 | |
python -m pip install pytest-isolate pytest-xdist | |
pip install 'build<0.10.0' | |
- name: Symlink gfortran for macOS | |
run: | | |
# make sure gfortran is available | |
ln -s /opt/homebrew/bin/gfortran-13 /opt/homebrew/bin/gfortran | |
gfortran --version | |
- name: Build wheels | |
run: python -m build | |
- name: Upload maxOS wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.pyversions }} | |
path: dist/*.whl | |
# - name: Delocate macOS wheels | |
# run: | | |
# pip install delocate | |
# mkdir delocated_wheels | |
# delocate-wheel -w delocated_wheels dist/*.whl | |
# - name: Upload maxOS wheels | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ matrix.os }}-${{ matrix.pyversions }} | |
# path: delocated_wheels/*.whl | |
gather_wheels: | |
needs: [build_wheels, build_arm_wheels] | |
name: Gathers built wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: wheels | |
merge-multiple: true | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: all_wheels | |
path: wheels |