mirror of https://github.com/mamba-org/mamba.git
140 lines
4.5 KiB
YAML
140 lines
4.5 KiB
YAML
name: Unix tests impl
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
os:
|
|
required: true
|
|
type: string
|
|
build_type:
|
|
required: true
|
|
type: string
|
|
|
|
defaults:
|
|
run:
|
|
# micromamba activation
|
|
shell: bash -l -eo pipefail {0}
|
|
|
|
jobs:
|
|
build_shared_unix:
|
|
name: Build binaries
|
|
runs-on: ${{ inputs.os }}
|
|
steps:
|
|
- name: Checkout mamba repository
|
|
uses: actions/checkout@v4
|
|
- name: Create build environment
|
|
uses: mamba-org/setup-micromamba@v1
|
|
with:
|
|
environment-file: ./dev/environment-dev.yml
|
|
environment-name: build_env
|
|
cache-environment: true
|
|
- uses: hendrikmuhs/ccache-action@main
|
|
with:
|
|
variant: sccache
|
|
key: ${{ github.job }}-${{ inputs.os }}
|
|
restore-keys: |
|
|
ccache-libmamba-${{ inputs.os }}
|
|
- name: Build mamba
|
|
run: |
|
|
cmake -B build/ -G Ninja \
|
|
--preset mamba-unix-shared-${{ inputs.build_type }} \
|
|
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
|
|
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
|
|
-D BUILD_LIBMAMBAPY=OFF
|
|
cmake --build build/ --parallel
|
|
- name: Show build cache statistics
|
|
run: sccache --show-stats
|
|
- name: Lock environment
|
|
run: micromamba env export --explicit > build/environment.lock
|
|
- name: Remove extra files before saving workspace
|
|
run: find build/ -type f -name '*.o' -exec rm {} +
|
|
- name: Save workspace
|
|
uses: ./.github/actions/workspace
|
|
with:
|
|
action: save
|
|
path: build/
|
|
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
|
|
|
|
libmamba_tests_unix:
|
|
name: Test libmamba
|
|
needs: ["build_shared_unix"]
|
|
runs-on: ${{ inputs.os }}
|
|
steps:
|
|
- name: Checkout mamba repository
|
|
uses: actions/checkout@v4
|
|
- name: Restore workspace
|
|
uses: ./.github/actions/workspace
|
|
with:
|
|
action: restore
|
|
path: build/
|
|
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
|
|
- name: Create build environment
|
|
uses: mamba-org/setup-micromamba@v1
|
|
with:
|
|
environment-file: ./build/environment.lock
|
|
environment-name: build_env
|
|
- name: Run libmamba tests
|
|
run: |
|
|
unset CONDARC # Interferes with tests
|
|
./build/libmamba/tests/test_libmamba
|
|
|
|
libmambapy_tests_unix:
|
|
name: Test libmamba Python bindings
|
|
needs: ["build_shared_unix"]
|
|
runs-on: ${{ inputs.os }}
|
|
steps:
|
|
- name: Checkout mamba repository
|
|
uses: actions/checkout@v4
|
|
- name: Restore workspace
|
|
uses: ./.github/actions/workspace
|
|
with:
|
|
action: restore
|
|
path: build/
|
|
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
|
|
- name: Create build environment
|
|
uses: mamba-org/setup-micromamba@v1
|
|
with:
|
|
environment-file: ./build/environment.lock
|
|
environment-name: build_env
|
|
- name: Install libmambapy
|
|
run: |
|
|
cmake --install build/ --prefix "${CONDA_PREFIX}"
|
|
# TODO add some ccache and parallelism to builds
|
|
python -m pip install --no-deps --no-build-isolation ./libmambapy
|
|
- name: Run libmamba Python bindings tests
|
|
run: |
|
|
python -m pytest libmambapy/tests/ ${{ runner.debug == 'true' && '-v' || '--exitfirst' }}
|
|
|
|
mamba_integration_tests_unix:
|
|
name: Test integration mamba
|
|
needs: ["build_shared_unix"]
|
|
runs-on: ${{ inputs.os }}
|
|
steps:
|
|
- name: Checkout mamba repository
|
|
uses: actions/checkout@v4
|
|
- name: Restore workspace
|
|
uses: ./.github/actions/workspace
|
|
with:
|
|
action: restore
|
|
path: build/
|
|
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
|
|
- name: Create build environment
|
|
uses: mamba-org/setup-micromamba@v1
|
|
with:
|
|
environment-file: ./build/environment.lock
|
|
environment-name: build_env
|
|
- name: install zsh, xonsh, fish and tcsh in linux
|
|
if: startsWith(inputs.os, 'ubuntu')
|
|
run: |
|
|
sudo apt-get install zsh xonsh fish tcsh -y
|
|
- name: install xonsh and fish in mac
|
|
if: startsWith(inputs.os, 'macos')
|
|
run: |
|
|
brew install fish xonsh
|
|
- name: mamba python based tests
|
|
run: |
|
|
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
|
|
unset CONDARC # Interferes with tests
|
|
python -m pytest micromamba/tests/ \
|
|
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
|