From 64c2dbe110a5765de74e7acff8272a12b59364bc 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 | 5 +---- ci/make-env.sh | 5 +---- ci/setup-conda.sh | 15 --------------- 5 files changed, 20 insertions(+), 33 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..014afc1 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 conda-verify 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 conda-verify 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..f986f4a 100755 --- a/ci/build-package.sh +++ b/ci/build-package.sh @@ -1,10 +1,7 @@ #!/bin/bash set -e -cd "$(dirname "$0")" -source ./activate-conda.sh - -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..a4a5a85 100755 --- a/ci/make-env.sh +++ b/ci/make-env.sh @@ -1,10 +1,7 @@ #!/bin/bash set -e -cd "$(dirname "$0")" -source ./activate-conda.sh - -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