Skip to content

Example workflow for win - Restructuring for build #1

Example workflow for win - Restructuring for build

Example workflow for win - Restructuring for build #1

name: Win - Python package using conda / pip
on: [push]
jobs:
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Conda with Python 3.12
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: magtense-env
environment-file: python/environment_win.yml
python-version: 3.12
auto-activate-base: false
- name: Compile Fortran files in Developer PowerShell for VS 2022
shell: pwsh -NoExit -ExecutionPolicy ByPass -File {0}
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\"
.\Launch-VsDevShell.ps1
cd ${{ github.workspace }}/python/src/magtense/lib/
make ps
- name: Compile with nvcc in x64 Native Tools Command Prompt for VS 2022
shell: cmd /k "{0}" -arch=amd64 -host_arch=x64
working-directory: ${{ github.workspace }}/source/MagTenseFortranCuda/cuda
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
nvcc -c MagTenseCudaBlas.cu -o MagTenseCudaBlas.o
- name: Link Cuda wrapper in Developer PowerShell for VS 2022
shell: pwsh -NoExit -ExecutionPolicy ByPass -File {0}
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\"
.\Launch-VsDevShell.ps1
cd ${{ github.workspace }}/source/MagTenseFortranCuda/cuda
make wrap
- name: Build Python wrapper in Command Prompt
shell: cmd /C CALL {0}
working-directory: ${{ github.workspace }}/python/src/magtense/lib/
run: >-
make cmdx64
- name: Install local magtense package with pip
run: python -m pip install -e ${{ github.workspace }}/python
- name: Test with pytest
run: |
conda install pytest
pytest