Skip to content

Commit

Permalink
Move GHA to setup-micromamba
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed May 26, 2023
1 parent 6792f50 commit 1bb6ab3
Showing 1 changed file with 37 additions and 70 deletions.
107 changes: 37 additions & 70 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -xe -o pipefail -l {0}

jobs:
libmamba_static:
runs-on: ${{ matrix.os }}
Expand All @@ -21,17 +25,16 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-static-dev.yml
environment-name: build_env
cache-env: true
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
- name: build libmamba-static
shell: bash -l {0}
run: |
micromamba activate build_env
mkdir build
Expand All @@ -45,10 +48,9 @@ jobs:
- name: build cache statistics
run: sccache --show-stats
- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
libmamba_cpp_tests:
Expand All @@ -60,19 +62,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-dev.yml
environment-name: build_env
cache-env: true
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static-${{ matrix.os }}
- name: build and run libmamba C++ tests
shell: bash -l {0}
run: |
micromamba activate build_env
mkdir build
Expand All @@ -88,10 +89,9 @@ jobs:
- name: build cache statistics
run: sccache --show-stats
- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
umamba_tests:
Expand All @@ -103,19 +103,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
cache-env: true
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static-${{ matrix.os }}
- name: build micromamba
shell: bash -l {0}
run: |
micromamba activate build_env
mkdir build
Expand All @@ -132,25 +131,19 @@ jobs:
run: sccache --show-stats
- name: install zsh, xonsh, fish and tcsh in linux
if: matrix.os == 'ubuntu-latest'
shell: bash -l -eo pipefail {0}
run: |
sudo apt-get install zsh xonsh fish tcsh -y
run: sudo apt-get install zsh xonsh fish tcsh -y
- name: install xonsh and fish in mac
if: matrix.os == 'macos-latest'
shell: bash -l -eo pipefail {0}
run: |
brew install fish xonsh
run: brew install fish xonsh
- name: micromamba python based tests
shell: bash -l -eo pipefail {0}
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/micromamba
micromamba activate build_env
pytest -v --capture=tee-sys micromamba/tests/
- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
mamba_python_tests:
Expand All @@ -164,12 +157,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./mamba/environment-dev.yml
environment-name: build_env
cache-env: true
extra-specs: |
cache-environment: true
create-args: |
conda-build
python=${{ matrix.python_version }}
- uses: hendrikmuhs/ccache-action@main
Expand All @@ -179,10 +172,8 @@ jobs:
restore-keys: |
libmamba_static-${{ matrix.os }}
- name: run conda init
shell: bash -l {0}
run: conda init
- name: build libmamba Python bindings
shell: bash -l {0}
run: |
micromamba activate build_env
mkdir build
Expand All @@ -198,36 +189,30 @@ jobs:
ninja
ninja install
- name: install libmambapy
shell: bash -l {0}
run: |
micromamba activate build_env
pip install -e ./libmambapy/ --no-deps
- name: check libmambapy stubs
shell: bash -l {0}
run: |
pybind11-stubgen libmambapy.bindings
python compare_stubs.py libmambapy/libmambapy/__init__.pyi stubs/libmambapy/bindings-stubs/__init__.pyi
- name: build cache statistics
run: sccache --show-stats
- name: install mamba
shell: bash -l {0}
run: |
micromamba activate build_env
pip install ./mamba[test] --no-deps
- name: run mamba tests suite
shell: bash -l {0}
run: |
micromamba activate build_env
pytest -v --capture=tee-sys mamba/tests
- name: run mamba create/update tests
shell: bash -l {0}
run: |
micromamba activate build_env
mamba create -n test_env xtensor -c conda-forge -y
mamba env create -f mamba/tests/test_env.yml
mamba env update -f mamba/tests/update_env.yml
- name: run mamba local channel test
shell: bash -l {0}
run: |
micromamba activate build_env
if [ "$RUNNER_OS" == "Linux" ]; then
Expand All @@ -248,7 +233,6 @@ jobs:
exit 1
fi
- name: Run server auth tests
shell: bash -l {0} -euo pipefail -x
run: |
micromamba activate build_env
cd mamba/tests
Expand All @@ -262,15 +246,12 @@ jobs:
./testserver.sh
- name: Shell init
shell: bash -l {0} -euo pipefail -x
run: |
mamba init
run: mamba init

- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
libmamba_static_win:
Expand All @@ -282,11 +263,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-static-dev-win.yml
environment-name: build_env
cache-env: true
cache-environment: true
- name: fix up vcpkg recipes
shell: python
run: |
Expand Down Expand Up @@ -359,7 +340,7 @@ jobs:
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
mamba_python_tests_win:
Expand All @@ -373,12 +354,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./mamba/environment-dev.yml
environment-name: build_env
cache-env: true
extra-specs: |
cache-environment: true
create-args: |
conda-build
curl
- uses: hendrikmuhs/ccache-action@main
Expand All @@ -388,7 +369,6 @@ jobs:
restore-keys: |
libmamba_static_win-${{ matrix.os }}
- name: run conda init
shell: bash -l {0}
run: conda init
- name: build libmamba Python bindings
shell: cmd /C call {0}
Expand Down Expand Up @@ -419,24 +399,18 @@ jobs:
- name: build cache statistics
run: sccache --show-stats
- name: install mamba
shell: bash -l {0}
run: |
python --version
pip install ./mamba[test] --no-deps
- name: run mamba tests suite
shell: bash -l {0}
run: pytest -v --capture=tee-sys mamba/tests
- name: Run create command
shell: bash -l {0}
run: mamba create -n test_env xtensor -c conda-forge -y
- name: Run env create command
shell: bash -l {0}
run: mamba env create -f mamba/tests/test_env.yml
- name: Run env update command
shell: bash -l {0}
run: mamba env update -f mamba/tests/update_env.yml
- name: Run local channel checks
shell: bash -l {0}
run: |
mkdir -p $CONDA_PREFIX/conda-bld/win-64
echo $PATH
Expand All @@ -455,10 +429,9 @@ jobs:
exit 1
fi
- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
libmamba_cpp_tests_win:
Expand All @@ -472,11 +445,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-dev.yml
environment-name: build_env
cache-env: true
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
Expand Down Expand Up @@ -506,10 +479,9 @@ jobs:
- name: build cache statistics
run: sccache --show-stats
- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
umamba_tests_win:
Expand All @@ -522,11 +494,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
cache-env: true
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
Expand Down Expand Up @@ -568,10 +540,9 @@ jobs:
name: _internal_micromamba_binary
path: umamba.tar
- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs
umamba_tests_win_cmd:
Expand All @@ -589,16 +560,14 @@ jobs:
name: _internal_micromamba_binary

- name: untar micromamba artifact
shell: bash -l -eo pipefail {0}
run: |
tar -xvf umamba.tar
run: tar -xvf umamba.tar

- name: create build environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
extra-specs: menuinst
create-args: menuinst

- name: micromamba python based tests with pwsh
shell: powershell
Expand Down Expand Up @@ -626,7 +595,6 @@ jobs:
# pytest -v --capture=tee-sys micromamba/tests/test_shell.py

# - name: micromamba python based tests
# shell: bash -l -eo pipefail {0}
# run: |
# export PYTHONIOENCODING=UTF-8
# export MAMBA_ROOT_PREFIX=~/mambaroot
Expand All @@ -635,8 +603,7 @@ jobs:
# pytest -v --capture=tee-sys micromamba/tests/test_shell.py

- name: Cleanup
shell: bash
if: always()
run: |
# Do not cache temporary envs with 'cache-env: true'
# Do not cache temporary envs with 'cache-environment: true'
rm -rf ~/micromamba*/envs/*/envs

0 comments on commit 1bb6ab3

Please sign in to comment.