Skip to content

more messing around with CI, take 4 #2404

more messing around with CI, take 4

more messing around with CI, take 4 #2404

Workflow file for this run

name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [windows-latest]
python: ["3.12"]
env:
CONDA_ENV_NAME: stdpopsim
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- name: cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: checkout
uses: actions/[email protected]
- name: Cache conda and dependencies
id: cache
uses: actions/[email protected]
env:
# Increase this to reset the cache if the key hasn't changed.
CACHE_NUM: 0
with:
path: ${{ env.CONDA }}/envs
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-${{ env.CACHE_NUM }}-${{ hashFiles('requirements/CI/*') }}
- name: Install Conda
uses: conda-incubator/[email protected]
if: steps.cache.outputs.cache-hit != 'true'
with:
activate-environment: anaconda-client-env
python-version: ${{ matrix.python }}
channels: conda-forge
channel-priority: strict
auto-update-conda: true
- name: Fix windows .profile
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
run: |
pwd
echo "HOME: $HOME"
ls -a ~
echo ".bash_profile"
cat ~/.bash_profile
cp ~/.bash_profile ~/.profile
- name: Install conda deps
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0} #We need a login shell to get conda
run: |
conda install --yes --file=requirements/CI/conda.txt
- name: Install pip deps
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
echo "pip pwd:"
pwd
pip install -r requirements/CI/requirements.txt
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
# note: after logging in do:
# eval "$('/c/Miniconda/Scripts/conda.exe' 'shell.bash' 'hook')"
# conda activate "anaconda-client-env"
- name: run test suite
run: |
echo "test pwd"
pwd
which python
ls ~/.profile
source ~/.profile
conda activate anaconda-client-env
python -m pytest \
-n 0 \
-v \
tests