Skip to content

fix cmake dir

fix cmake dir #45

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
branches: [ Scattering-Farfield-CUDA ]
pull_request:
branches: [ Scattering-Farfield-CUDA ]
jobs:
build:
name: build (${{ matrix.python-version }}, ${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
platform:
- {
name: "linux",
os: "ubuntu-latest",
shell: "bash -l {0}"
}
- {
name: "windows",
os: "windows-latest",
shell: "powershell {0}"
}
environment:
name: build_env
defaults:
run:
shell: ${{ matrix.platform.shell }}
env:
REPO: "${{ github.event.pull_request.head.repo.full_name || github.repository }}"
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: build_env
miniforge-version: latest
#
- name: Clone the devel branch (push to devel)
run: git clone --branch Scattering-Farfield-CUDA https://github.com/${{ env.REPO }}
if: github.event_name != 'pull_request'
#
- name: Clone the feature branch (pull request to devel)
run: git clone --branch Scattering-Farfield-CUDA https://github.com/${{ env.REPO }}
if: github.event_name == 'pull_request'
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client ninja
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Configure MSVC environment
uses: ilammy/msvc-dev-cmd@v1
- name: Set CMAKE_GENERATOR env var
run: echo "CMAKE_GENERATOR=Ninja" >> $env:GITHUB_ENV
- name: CMake Generation - MSVC
shell: cmd
run: cmake -B build -DCMAKE_C_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER=${{ github.workspace }}/buildcache/bin/buildcache.exe ${{ github.workspace }}/LyceanEM-Python
- name: Build Project
shell: cmd
run: |
set CL=/MP
cmake --build build -j 2
- name: Build Conda package using mamba build
run:
conda mambabuild ${{ github.workspace }}/LyceanEM-Python/conda/
#
#
- name: Build Conda package using mamba build linux
if: runner.os == 'linux'
run:
conda mambabuild ${{ github.workspace }}/LyceanEM-Python/conda/
#
#
- name: Upload Conda package
run: python ${{ github.workspace }}/LyceanEM-Python/actions/upload.py
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: github.event_name != 'pull_request'