Skip to content

Merge pull request #35 from thermotools/prep_merge #25

Merge pull request #35 from thermotools/prep_merge

Merge pull request #35 from thermotools/prep_merge #25

Workflow file for this run

name: Run Tests
on: push
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, macOS-12, ubuntu-latest, windows-latest]
env:
THERMOPACK_DIR: thermopack-${{ matrix.os }}
THERMOPACK_URL: https://github.com/vegardjervell/thermopack/releases/download/Latest-beta
steps:
- uses: actions/checkout@v4
- name: checkout submodules
run: git submodule update --init --recursive
# Used to host cibuildwheel
- uses: actions/setup-python@v4
- name: Install thermopack
if: matrix.os != 'windows-latest'
run: |
curl -L -o thermopack.zip ${{ env.THERMOPACK_URL }}/thermopack-${{ matrix.os }}.zip
unzip thermopack.zip
export THERMOPACK_DIR=${PWD}/thermopack-${{ matrix.os }}/
curl -L -o thermopack_whl.zip ${{ env.THERMOPACK_URL }}/wheel-v2-${{ matrix.os }}.zip
unzip thermopack_whl.zip
pip install wheel-v2-${{ matrix.os }}/*
- name: Build KineticGas
if: matrix.os != 'windows-latest'
run: |
echo "THERMOPACK_DIR (GH_ENV) : ${{ env.THERMOPACK_DIR }} / (ENV) ${THERMOPACK_DIR}"
export THERMOPACK_DIR=${PWD}/${{ env.THERMOPACK_DIR }}
ls -R ${THERMOPACK_DIR}
mkdir build
cd build
cmake ..
make -j4 install
- name: Install thermopack Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Invoke-WebRequest -Uri "${{ env.THERMOPACK_URL }}/wheel-v2-${{ matrix.os }}.zip" -OutFile "thermopack_whl.zip"
Expand-Archive -Path "thermopack_whl.zip" -DestinationPath "wheel-v2-${{ matrix.os }}"
cd wheel-v2-${{ matrix.os }}
pip install (Get-ChildItem wheel-v2-windows-latest\*.whl).FullName
- name: Build KineticGas Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Invoke-WebRequest -Uri "${{ env.THERMOPACK_URL }}/thermopack-${{ matrix.os }}.zip" -OutFile "thermopack.zip"
Expand-Archive -Path "thermopack.zip" -DestinationPath "${{ env.THERMOPACK_DIR }}"
$THERMOPACK_DIR = "$PWD\${{ env.THERMOPACK_DIR }}\thermopack-${{ matrix.os }}"
[System.Environment]::SetEnvironmentVariable("THERMOPACK_DIR", $THERMOPACK_DIR)
ls -R ${THERMOPACK_DIR}
mkdir build
cd build
cmake ..
cmake --build . --config=Release --target install
- name: Build KineticGas Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
pip install .
$THERMOPACK_DIR = "$PWD/${{ env.THERMOPACK_DIR }}"
mkdir build
cd build
cmake ..
cmake --build . --config=Release --target install
- name: Inspect libpykingas
if: matrix.os != 'ubuntu-latest' && matrix.os != 'windows-latest'
run: otool -L pykingas/libpykingas.*
- name: Run pytests
run: |
pip install .[test]
pytest tests/