From 7f63d32ede3be6ba5f3c298508db8987fc79a013 Mon Sep 17 00:00:00 2001 From: Ekaterina Noskova Date: Mon, 4 Nov 2024 20:45:59 +0100 Subject: [PATCH] Change tests --- .github/workflows/tests.yml | 49 +++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f7b7538..31cdc85 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,15 +31,50 @@ jobs: - name: Checkout. uses: actions/checkout@v2 - - name: Set up Conda environment. - uses: conda-incubator/setup-miniconda@v3 + - name: find conda + id: find-conda + run: | + echo "CONDA=$CONDA" >> $GITHUB_OUTPUT + + - name: fix conda permissions + if: runner.os == 'macOS' + run: | + # Fix incorrect conda permissions on mac that prevent cache restore. + sudo chown -R $USER:staff ${{ steps.find-conda.outputs.CONDA }} + + - name: cache conda + id: cache + uses: actions/cache@v3 + env: + # Increase this to reset the cache if the key hasn't changed. + CACHE_NUM: 9 + with: + path: | + ${{ steps.find-conda.outputs.CONDA }}/envs/${{ env.CONDA_ENV_NAME }} + ~/.bash_profile + key: ${{ runner.os }}-${{ matrix.python }}-conda-${{ hashFiles('requirements/CI/*') }}-${{ env.CACHE_NUM }} + + - name: install conda + uses: conda-incubator/setup-miniconda@v2 + if: steps.cache.outputs.cache-hit != 'true' with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - channels: conda-forge,bioconda activate-environment: ${{ env.CONDA_ENV_NAME }} - - - name: Install dadi and scikit-allel using conda. + python-version: ${{ matrix.python }} + channels: conda-forge, bioconda + channel-priority: strict + auto-update-conda: true + use-only-tar-bz2: true + + - name: move profile + if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows' + run: | + # The setup-miniconda action leaves different shell init files for + # different OSes. Bash gives priority to ~/.bash_profile, so here we + # ensure that's used for all platforms. + mv ~/.profile ~/.bash_profile + + - name: install dadi and scikit-allel using conda. + if: steps.cache.outputs.cache-hit != 'true' run: | conda install dadi conda install scikit-allel