From 599bbf0249c4ab917bd2545fb1e3979baf4ba80e Mon Sep 17 00:00:00 2001 From: Andrew Simms Date: Tue, 16 Apr 2024 12:39:29 -0600 Subject: [PATCH] Actions: Test simpler python installation --- .github/workflows/windows_unit_tests.yml | 116 ++++++++++++++++------- 1 file changed, 81 insertions(+), 35 deletions(-) diff --git a/.github/workflows/windows_unit_tests.yml b/.github/workflows/windows_unit_tests.yml index d64bd4e2..7f7367ed 100644 --- a/.github/workflows/windows_unit_tests.yml +++ b/.github/workflows/windows_unit_tests.yml @@ -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 @@ -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} @@ -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