Skip to content

Restructure for flang 19 #85

Restructure for flang 19

Restructure for flang 19 #85

Workflow file for this run

name: Test
on: [push, pull_request]
env:
BUILD_DIR: _build
jobs:
build-test-unix:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: latest
environment-file: environment.yml
- name: Build and install HeatModelF
run: |
pushd ./external/bmi-example-fortran
cmake -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
cmake --build ${{ env.BUILD_DIR }} --target install --config Release
popd
- name: Build and install package
run: |
make install
- name: Test BMI
run: |
python -c 'import pymt_heatf'
make test
- name: Run examples
working-directory: ${{ github.workspace }}/examples
run: |
python heatf_ex.py
python pymt_heatf_ex.py
build-test-windows:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: latest
environment-file: environment.yml
init-shell: >-
powershell
- name: Set the PREFIX environment variable
run: |
echo "PREFIX=$env:MAMBA_ROOT_PREFIX\envs\fbld\Library" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Set the FC environment variable
run: |
echo "FC=$env:PREFIX\bin\flang-new.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# - name: Make a LINKER environment variable
# run: |
# echo "LINKER=$env:VCToolsInstallDir\bin\Host$env:RUNNER_ARCH\$env:Platform\link.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: View environment variables
run: |
ls env:
- name: Configure, build, and install HeatModelF
run: |
cmake ./external/bmi-example-fortran -B ${{ env.BUILD_DIR }} -LA -G Ninja -DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} -DCMAKE_BUILD_TYPE=Release
cmake --build ${{ env.BUILD_DIR }} --target install --config Release
- name: Build and install package
run: |
make install