Skip to content

Commit

Permalink
Actions: Test simpler python installation
Browse files Browse the repository at this point in the history
  • Loading branch information
simmsa committed Apr 16, 2024
1 parent f1ac329 commit 599bbf0
Showing 1 changed file with 81 additions and 35 deletions.
116 changes: 81 additions & 35 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,32 +148,55 @@ jobs:
env:
mhkit-python-dir: "MHKiT-Python"
steps:
- name: Install/Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: MHKIT_CONDA_ENV
channels: conda-forge
# - name: Install/Setup Miniconda
# uses: conda-incubator/setup-miniconda@v3
# with:
# auto-update-conda: true
# python-version: ${{ matrix.python-version }}
# activate-environment: MHKIT_CONDA_ENV
# channels: conda-forge

# - name: "Conda install h5py, netcdf4, and cython"
# run: |
# conda activate MHKIT_CONDA_ENV
# conda install -c conda-forge h5py netcdf4 cython

- name: "Conda install h5py, netcdf4, and cython"
run: |
conda activate MHKIT_CONDA_ENV
conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4 --strict-channel-priority
# - name: "Conda install h5py, netcdf4, and cython"
# run: |
# conda activate MHKIT_CONDA_ENV
# conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4 --strict-channel-priority

# - name: Output python executable
# run: |
# conda activate MHKIT_CONDA_ENV
# python -c "import sys; print(sys.executable)"

# - name: Print Python Version
# run: |
# conda activate MHKIT_CONDA_ENV
# python --version

# - name: Output python executable
# run: |
# conda activate MHKIT_CONDA_ENV
# python -c "import sys; print(sys.executable)"

# - name: Print Python Version
# run: |
# conda activate MHKIT_CONDA_ENV
# python --version

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Output python executable
run: |
conda activate MHKIT_CONDA_ENV
python -c "import sys; print(sys.executable)"

- name: Print Python Version
run: |
conda activate MHKIT_CONDA_ENV
python --version

- name: Check out MHKiT-MATLAB
Expand All @@ -185,36 +208,54 @@ jobs:
repository: "MHKiT-Software/MHKiT-Python"
path: ${{env.mhkit-python-dir}}

# - name: pip install mhkit from source
# working-directory: ${{env.mhkit-python-dir}}
# run: |
# conda activate MHKIT_CONDA_ENV
# pip install -e .

- name: pip install mhkit from source
working-directory: ${{env.mhkit-python-dir}}
run: |
conda activate MHKIT_CONDA_ENV
pip install -e .

# - name: pip install mhkit-python-utils module from source
# run: |
# conda activate MHKIT_CONDA_ENV
# pip install -e .

- name: pip install mhkit-python-utils module from source
run: |
conda activate MHKIT_CONDA_ENV
pip install -e .

# - name: List installed pip modules
# run: |
# conda activate MHKIT_CONDA_ENV
# pip freeze

- name: List installed pip modules
run: |
conda activate MHKIT_CONDA_ENV
pip freeze

# - name: Print MHKiT-Python Version
# shell: bash -l {0}
# run: |
# conda activate MHKIT_CONDA_ENV
# python -c "import mhkit; print(mhkit.__version__)"

- name: Print MHKiT-Python Version
shell: bash -l {0}
run: |
conda activate MHKIT_CONDA_ENV
python -c "import mhkit; print(mhkit.__version__)"

- name: LS Conda Env Dir
shell: bash -l {0}
run: 'ls C:\\Miniconda\\envs\\MHKIT_CONDA_ENV'
# - name: LS Conda Env Dir
# shell: bash -l {0}
# run: 'ls C:\\Miniconda\\envs\\MHKIT_CONDA_ENV'

- name: Echo Path
shell: bash -l {0}
run: |
echo $GITHUB_PATH
# - name: Echo Path
# shell: bash -l {0}
# run: |
# echo $GITHUB_PATH

# - name: Tree Conda Env Dir
# shell: bash -l {0}
Expand All @@ -223,23 +264,28 @@ jobs:
# - name: Add anaconda env to path
# shell: bash -l {0}
# run: 'echo C:\\Miniconda\\envs\\MHKIT_CONDA_ENV >> $GITHUB_PATH'
- name: Add anaconda env to path
shell: pwsh
run: Add-Content $env:GITHUB_PATH "C:\Miniconda\envs\MHKIT_CONDA_ENV"
# - name: Add anaconda env to path
# shell: pwsh
# run: Add-Content $env:GITHUB_PATH "C:\Miniconda\envs\MHKIT_CONDA_ENV"

- name: Add anaconda env to path
shell: pwsh
run: echo "C:\Miniconda\envs\MHKIT_CONDA_ENV" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# - name: Add anaconda env to path
# shell: pwsh
# run: echo "C:\Miniconda\envs\MHKIT_CONDA_ENV" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Echo Path
shell: bash -l {0}
run: |
echo $GITHUB_PATH
# - name: Echo Path
# shell: bash -l {0}
# run: |
# echo $GITHUB_PATH

# - name: Verify MHKiT-Python Operation
# shell: bash -l {0}
# run: |
# conda activate MHKIT_CONDA_ENV
# python -c "import mhkit; [ED, AP] = mhkit.river.performance.circular(30); print(ED); print(AP);"

- name: Verify MHKiT-Python Operation
shell: bash -l {0}
run: |
conda activate MHKIT_CONDA_ENV
python -c "import mhkit; [ED, AP] = mhkit.river.performance.circular(30); print(ED); print(AP);"

- name: Download mhkit_webread_cache artifact
Expand Down

0 comments on commit 599bbf0

Please sign in to comment.