-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (116 loc) · 4.57 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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 imports
working-directory: ${{ github.workspace }}/examples
run: |
python -c 'import pymt_heatf'
python -c 'from pymt.models import HeatModelF'
- name: Test BMI
run: |
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
env:
LIBRARY_PREFIX: $env:CONDA_PREFIX\Library
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:CONDA_PREFIX\Library\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: Make a LINK_DIR environment variable for MSVC link.exe
# run: |
# echo "LINK_DIR=$env:VCToolsInstallDir\bin\Host$env:RUNNER_ARCH\$env:Platform" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# - name: Push location of MSVC link.exe to the front of the path
# run: |
# echo "Path=$env:LINK_DIR;$env:Path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# - name: Force location of MSVC link.exe to the front of the path
# run: |
# echo "$env:VCToolsInstallDir\bin\Host$env:RUNNER_ARCH\$env:Platform" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Remove link.exe in the Git install
run: |
Remove-Item -Path "C:\Program Files\Git\usr\bin\link.exe" -Force
- name: Add conda environment libpath to Windows LIB (not LIBPATH)
run: |
echo "LIB=$env:LIB;$env:CONDA_PREFIX\Library\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: View environment variables
run: |
ls env:
ls env:LIB
- name: Configure, build, and install HeatModelF
run: |
pushd ./external/bmi-example-fortran
cmake -B ${{ env.BUILD_DIR }} -LA -G Ninja -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build ${{ env.BUILD_DIR }} --target install --config Release
popd
- name: Build and install package
run: |
make install
- name: Test imports
working-directory: ${{ github.workspace }}/examples
run: |
python -c 'import pymt_heatf'
python -c 'from pymt.models import HeatModelF'
- name: Test BMI
working-directory: ${{ github.workspace }}
run: |
bmi-test pymt_heatf._bmi:HeatModelF --config-file=${{ github.workspace }}/examples/test.cfg --root-dir=examples -vvv
- name: Run examples
working-directory: ${{ github.workspace }}/examples
run: |
python heatf_ex.py
python pymt_heatf_ex.py