Skip to content

Commit

Permalink
Split Windows build test into a separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Nov 8, 2024
1 parent 8c9b84a commit 98a6d98
Showing 1 changed file with 52 additions and 11 deletions.
63 changes: 52 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ name: Test
on: [push, pull_request]

jobs:
build-and-test:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
build-test-unix:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ${{ matrix.os }}

Expand All @@ -19,22 +15,66 @@ jobs:

strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [windows-latest]
os: [ubuntu-latest, macos-latest]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: fbld
environment-file: environment.yml
python-version: ${{ matrix.python-version }}

- name: Show conda installation info
run: |
conda info
conda list
- name: Build and install package
run: |
pip install .[dev]
- name: Test import
working-directory: ${{ github.workspace }}/examples
run: |
python -c 'import pymt_ecsimplesnow'
python -c 'from pymt.models import ECSimpleSnow'
# The bmi-tester isn't available for bmi-fortran=1.2
# - name: Test BMI
# run: |
# make test

- name: Run examples
working-directory: ${{ github.workspace }}/examples
run: |
python ecsimplesnow_pymt_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

env:
LIBRARY_PREFIX: $env:CONDA_PREFIX\Library

steps:
- uses: actions/checkout@v4

- uses: ilammy/msvc-dev-cmd@v1
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: fbld
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
python-version: "3.12"

- name: Show conda installation info
run: |
Expand All @@ -43,7 +83,8 @@ jobs:
- name: Build and install package
run: |
FC=${{ env.LIBRARY_PREFIX }}\bin\flang.exe pip install .[dev]
# FC="${{ env.LIBRARY_PREFIX }}\bin\flang.exe" pip install .[dev]
pip install .[dev]
- name: Test import
working-directory: ${{ github.workspace }}/examples
Expand Down

0 comments on commit 98a6d98

Please sign in to comment.