cmake/xplatform builds using github/tox/conda workflows #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CondaDev | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
- develop | |
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' | |
generator: 'Ninja' | |
build_type: 'Release' | |
- os: 'ubuntu-20.04' | |
generator: 'Ninja' | |
build_type: 'RelWithDebInfo' | |
- os: 'macOS-11' | |
generator: 'Ninja' | |
build_type: 'Release' | |
- os: 'windows-2019' | |
generator: 'Ninja' | |
build_type: 'Release' | |
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.10' | |
- 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: 2 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.devenv.yml') }} | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
channel-priority: flexible | |
- name: Configure condadev environment | |
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=3.2.0 | |
conda devenv | |
- name: Display condadev environment | |
env: | |
PY_VER: ${{ matrix.python-version }} | |
run: | | |
conda info | |
conda list | |
conda config --show-sources | |
conda config --show | |
printenv | sort | |
- name: Build and test | |
env: | |
PY_VER: ${{ matrix.python-version }} | |
run: | | |
conda activate abc-test | |
conda info | |
conda list | |
ctest --build-generator "${{ matrix.generator }}" \ | |
--build-and-test . build \ | |
--build-options ${CMAKE_ARGS} ${{ matrix.extra_args }} \ | |
-DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
--test-command ctest --rerun-failed --output-on-failure -V |