From d283fb3a389a2d7e92162b00d9192ce4b0ca95e7 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Sun, 3 Dec 2023 10:28:54 -0800 Subject: [PATCH] chg: usr: update devenv file and conda-dev workflow, update win path * update setup-miniconda config to get latest pkg versions * add more workflow output, reset cache number * list envs, try moving closer to upstream examples Signed-off-by: Stephen L Arnold --- .github/workflows/conda-dev.yml | 35 ++++++++++++--------------------- .gitignore | 1 + CMakeLists.txt | 2 +- environment.devenv.yml | 13 +++++++++--- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/conda-dev.yml b/.github/workflows/conda-dev.yml index 8d1539c56a..787097d641 100644 --- a/.github/workflows/conda-dev.yml +++ b/.github/workflows/conda-dev.yml @@ -12,11 +12,13 @@ jobs: build: name: abc ${{ matrix.python-version }} ${{ matrix.os }} runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -el {0} strategy: fail-fast: false matrix: os: ['ubuntu-22.04', 'ubuntu-20.04', 'macOS-11', 'windows-2019'] - python-version: ['3.11'] use_namespace: [false, true] include: - os: 'ubuntu-22.04' @@ -34,52 +36,41 @@ jobs: extra_args: '-DABC_USE_NO_PTHREADS=ON -DABC_USE_NO_READLINE=ON' env: OS: ${{ matrix.os }} - PYTHON: ${{ matrix.python-version }} PYTHONIOENCODING: utf-8 CMAKE_ARGS: ${{ matrix.use_namespace && '-DABC_USE_NAMESPACE=xxx' || '' }} steps: - uses: actions/checkout@v3 - - name: Setup base python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Cache conda id: cache uses: actions/cache@v3 env: # Increase this value to reset cache if environment.devenv.yml has not changed - CACHE_NUMBER: 1 + CACHE_NUMBER: 3 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.devenv.yml') }} - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: ${{ matrix.python-version }} + auto-activate-base: true channels: conda-forge - channel-priority: strict - use-only-tar-bz2: true + channel-priority: flexible - name: Configure condadev environment - shell: bash -l {0} - env: - PY_VER: ${{ matrix.python-version }} run: | conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda install conda-devenv=2.1.1 - conda devenv + conda install conda-devenv=3.2.0 + conda info + conda list - name: Build and test - shell: bash -l {0} - env: - PY_VER: ${{ matrix.python-version }} run: | - source activate abc-test + conda devenv + conda info --envs + conda list dirent ctest --build-generator "${{ matrix.generator }}" \ --build-and-test . build \ --build-options ${CMAKE_ARGS} ${{ matrix.extra_args }} \ diff --git a/.gitignore b/.gitignore index 01dc15b930..395a751570 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ abc.history .tox/ staging/ +environment.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index 9912588549..6a504ff5b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,7 +176,7 @@ if(WIN32) add_definitions(-DWIN32 -D__MINGW32__ -DHAVE_STRUCT_TIMESPEC) if(DEFINED ENV{CONDA_PREFIX}) target_include_directories(abc_interface - INTERFACE $ENV{CONDA_PREFIX}/include + INTERFACE $ENV{CONDA_PREFIX}/Library/include ) endif() endif() diff --git a/environment.devenv.yml b/environment.devenv.yml index 7943367fe4..3098713675 100644 --- a/environment.devenv.yml +++ b/environment.devenv.yml @@ -1,7 +1,7 @@ -name: abc-test +name: abc dependencies: - - python ={{ get_env("PY_VER", default="3.9") }} + - python ={{ get_env("PY_VER", default="3.10") }} - cmake>=3.18 - ninja - c-compiler @@ -10,4 +10,11 @@ dependencies: - readline=8.1 # [unix] - zlib - libpng - - dirent >=1.21,<2.0 # [win] + - dirent # [win] + +environment: + CPATH: + - $CONDA_PREFIX/include # [unix] + - $CONDA_PREFIX/Library/include # [win] + + LD_LIBRARY_PATH: $CONDA_PREFIX/lib # [unix]