From 875f53c7835dd56491ca0ad8be24991d25446999 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 20 Aug 2024 21:17:43 +0200 Subject: [PATCH] Use official conda-action --- .github/workflows/package.yml | 20 ++++++++++++++++++-- ci/activate-conda.sh | 8 -------- ci/build-package.sh | 8 +++++--- ci/make-env.sh | 8 +++++--- ci/setup-conda.sh | 15 --------------- 5 files changed, 28 insertions(+), 31 deletions(-) delete mode 100755 ci/activate-conda.sh delete mode 100755 ci/setup-conda.sh diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index bdbfae5..4d76c96 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -16,7 +16,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Conda - run: ./ci/setup-conda.sh + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + channel-priority: strict + channels: conda-forge + - name: Install global deps + run: | + conda install conda-build anaconda-client + conda info -a - name: Build Pytest-Mpl run: ./ci/build-package.sh pytest-mpl env: @@ -48,7 +56,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Conda - run: ./ci/setup-conda.sh + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + channel-priority: strict + channels: conda-forge + - name: Install global deps + run: | + conda install conda-build anaconda-client + conda info -a - name: Make Env run: ./ci/make-env.sh env: diff --git a/ci/activate-conda.sh b/ci/activate-conda.sh deleted file mode 100755 index 478704e..0000000 --- a/ci/activate-conda.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -source "${CONDA}/etc/profile.d/conda.sh" -conda activate base - -function RQ() { - echo ">>>" "$@" - "$@" -} diff --git a/ci/build-package.sh b/ci/build-package.sh index 22e8559..9f542bc 100755 --- a/ci/build-package.sh +++ b/ci/build-package.sh @@ -1,10 +1,12 @@ #!/bin/bash set -e -cd "$(dirname "$0")" -source ./activate-conda.sh +function RQ() { + echo ">>>" "$@" + "$@" +} -cd .. +cd "$(dirname "$0")"/.. PKG="$1" MF="./build/$1/meta.yaml" diff --git a/ci/make-env.sh b/ci/make-env.sh index cd5253f..e6dfa8e 100755 --- a/ci/make-env.sh +++ b/ci/make-env.sh @@ -1,10 +1,12 @@ #!/bin/bash set -e -cd "$(dirname "$0")" -source ./activate-conda.sh +function RQ() { + echo ">>>" "$@" + "$@" +} -cd .. +cd "$(dirname "$0")"/.. export MPLBACKEND=agg export OGGM_USE_MP_SPAWN=1 diff --git a/ci/setup-conda.sh b/ci/setup-conda.sh deleted file mode 100755 index bffdc6f..0000000 --- a/ci/setup-conda.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -e - -cd "$(dirname "$0")" -source ./activate-conda.sh - -if [[ "${RUNNER_OS}" != "Windows" ]]; then - RQ sudo chown -R "$(id -u):$(id -g)" "$CONDA" -fi - -RQ conda config --set always_yes yes --set changeps1 no -RQ conda update -q conda -RQ conda update -c conda-forge -q --all -RQ conda install -c conda-forge -q conda-build "conda-verify>=3" anaconda-client -RQ conda info -a \ No newline at end of file