Skip to content

Commit 0803ded

Browse files
committed
FIX: ci better without bat files (they cannot execute conda comamnds)
1 parent 1752b17 commit 0803ded

File tree

5 files changed

+30
-1000
lines changed

5 files changed

+30
-1000
lines changed

.github/workflows/pypi-build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ jobs:
2424
auto-update-conda: true
2525
python-version: 3.9.1
2626

27+
- name: Create diff_check conda environment
28+
run: conda env create -f environment.yml
29+
30+
- name: Activate diff_check conda environment
31+
run: conda activate diff_check
32+
2733
- name: Cmake Configure
28-
run: ${{github.workspace}}/cmake/config.bat
34+
run: |
35+
cmake -S . -B build -A x64 -DBUILD_PYTHON_MODULE=ON
2936
- name: CMake Build
3037
run: ${{github.workspace}}/cmake/build.bat
3138

cmake/__noenv__clean_config.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

cmake/__noenv__config.bat

Lines changed: 0 additions & 5 deletions
This file was deleted.

cmake/activate_conda.bat

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@echo off
22
setlocal
33

4-
REM ########################################################################
5-
REM check if conda is available >
6-
REM check that diff_check environment is available >
7-
REM activate it
8-
REM ########################################################################
4+
:: ########################################################################
5+
:: check if conda is available >
6+
:: check that diff_check environment is available >
7+
:: activate it
8+
:: ########################################################################
99

10-
REM Check if conda command is available
10+
:: Check if conda command is available
1111
echo Checking if conda command is available...
1212
where conda >nul 2>nul
1313
if %ERRORLEVEL% equ 0 (
@@ -32,28 +32,29 @@ exit /b 1
3232
:end
3333
echo Anaconda3 found.
3434

35-
REM Check if the diff_check environment is available
35+
:: check if a different environment then diff_check is activated, if so deactivate it
36+
for /f "delims=" %%i in ('conda env list ^| findstr /C:"*"') do set "active_env=%%i"
37+
for /f "delims= " %%j in ("%active_env%") do set "active_env_name=%%j"
38+
if not "%active_env_name%"=="diff_check" (
39+
echo You should deactivating %active_env_name% firs
40+
echo Call "conda deactivate"
41+
)
42+
43+
:: Check if the diff_check environment is available
3644
call conda env list | findstr /C:"diff_check" >nul 2>nul
3745
if %ERRORLEVEL% neq 0 (
38-
echo diff_check environment not found, creating it now...
39-
40-
conda env create -f environment.yml && (
41-
echo Environment created successfully.
42-
) || (
43-
echo Failed to create diff_check environment, please check the environment.yml file.
44-
exit /b 1
45-
)
46+
echo diff_check environment not found, you should create one by running:
47+
echo $ conda env create -f environment.yml
48+
exit /b 1
4649
) else (
4750
echo diff_check environment is available, updating it now...
48-
49-
conda env update --name diff_check --file environment.yml --prune
50-
if %ERRORLEVEL% neq 0 (
51+
conda env update --name diff_check --file environment.yml --prune && (
52+
echo Environment created successfully.
53+
) || (
5154
echo Failed to update diff_check environment, please check the environment.yml file.
5255
exit /b 1
5356
)
5457
)
5558
echo diff_check environment is up to date.
5659

57-
REM activate the diff_check environment
58-
call conda activate diff_check
59-
echo diff_check environment activated.
60+
echo you can start the cmake config now ...

0 commit comments

Comments
 (0)