Skip to content

Commit 4a29fc6

Browse files
authored
Run the CI test workflow on Windows (#8)
* Update changelog * Add a job to run tests on Windows * Remove link.exe from Git package in CI runner * Remove exploratory code inherited from pymt_heatf * Run the bmi-tester * Call bmi-test directly to avoid ignored environment variable * Don't run bmi-tester because Windows
1 parent 59a874a commit 4a29fc6

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,69 @@ jobs:
5353
run: |
5454
python heatc_ex.py
5555
python pymt_heatc_ex.py
56+
57+
build-test-windows:
58+
if:
59+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
60+
61+
runs-on: windows-latest
62+
63+
env:
64+
LIBRARY_PREFIX: $env:CONDA_PREFIX\Library
65+
66+
defaults:
67+
run:
68+
shell: pwsh
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
with:
73+
submodules: true
74+
75+
- uses: ilammy/msvc-dev-cmd@v1
76+
77+
- uses: mamba-org/setup-micromamba@v2
78+
with:
79+
micromamba-version: latest
80+
environment-file: environment.yml
81+
init-shell: >-
82+
powershell
83+
84+
# A link.exe installed by chocolatey was ahead of the MSVC link.exe in the path.
85+
- name: Remove link.exe in the Git install
86+
run: |
87+
Remove-Item -Path "C:\Program Files\Git\usr\bin\link.exe" -Force
88+
89+
- name: View environment variables
90+
run: |
91+
ls env:
92+
93+
# The install prefix must be quoted.
94+
- name: Configure, build, and install HeatModelC
95+
run: |
96+
pushd ./external/bmi-example-c
97+
cmake -B _build -LA -G Ninja -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
98+
cmake --build _build --target install --config Release
99+
popd
100+
101+
- name: Build and install project
102+
run: |
103+
make install
104+
105+
- name: Test imports
106+
working-directory: ${{ github.workspace }}/examples
107+
run: |
108+
python -c 'import pymt_heatc'
109+
python -c 'from pymt.models import HeatModelC'
110+
111+
# Don't run bmi-test because Windows
112+
# - name: Test BMI
113+
# working-directory: ${{ github.workspace }}
114+
# run: |
115+
# bmi-test pymt_heatf._bmi:HeatModelC --config-file=${{ github.workspace }}\examples\config.txt --root-dir=examples -vvv
116+
117+
- name: Run examples
118+
working-directory: ${{ github.workspace }}/examples
119+
run: |
120+
python heatc_ex.py
121+
python pymt_heatc_ex.py

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 0.5 (unreleased)
44

5-
- Nothing changed yet.
5+
- Fix the test CI workflow (#7)
66

77

88
## 0.4 (2023-11-02)

0 commit comments

Comments
 (0)