Skip to content

Commit

Permalink
Simplify testing
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery committed Oct 17, 2023
1 parent 80e962d commit a1dc945
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 58 deletions.
58 changes: 12 additions & 46 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,66 +23,32 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ 3.7, 3.9 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
defaults:
run:
shell: bash
python: [ 3.8, 3.11 ]
# Reinstate windows-latest when msprime has wheels
os: [ macos-latest, ubuntu-latest] #, windows-latest ]
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

- name: Cache conda and dependancies
id: cache
uses: actions/cache@v2
with:
path: |
c:\Miniconda\envs\anaconda-client-env
/usr/share/miniconda/envs/anaconda-client-env
~/osx-conda
~/.profile
key: ${{ runner.os }}-${{ matrix.python}}-conda-v10-${{ hashFiles('requirements/CI-tests-conda.txt') }}

- name: Install Conda
uses: conda-incubator/setup-miniconda@v2
if: steps.cache.outputs.cache-hit != 'true'
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
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: |
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-tests-conda.txt

- name: Fix OSX Cache Write #OSX Won't let the cache restore due to file perms
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest'
run: |
cp -r /usr/local/miniconda/envs/anaconda-client-env ~/osx-conda
cache: 'pip'

- name: Fix OSX Cache Restore
if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest'
- name: Install dependencies
run: |
mkdir -p /usr/local/miniconda/envs
sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env
which python
which python3
python -m pip install -r requirements/ci.txt
- name: Run tests
run: |
source ~/.profile
conda activate anaconda-client-env
python -m pytest -xv -n2
24 changes: 12 additions & 12 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ queue_rules:
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- status-success=Lint
- status-success=Python (3.7, macos-latest)
- status-success=Python (3.9, macos-latest)
- status-success=Python (3.7, ubuntu-latest)
- status-success=Python (3.9, ubuntu-latest)
- status-success=Python (3.7, windows-latest)
- status-success=Python (3.9, windows-latest)
- status-success=Python (3.8, macos-latest)
- status-success=Python (3.11, macos-latest)
- status-success=Python (3.8, ubuntu-latest)
- status-success=Python (3.11, ubuntu-latest)
- status-success=Python (3.8, windows-latest)
- status-success=Python (3.11, windows-latest)
- "status-success=ci/circleci: build"
pull_request_rules:
- name: Automatic rebase, CI and merge
Expand All @@ -20,12 +20,12 @@ pull_request_rules:
- base=main
- label=AUTOMERGE-REQUESTED
- status-success=Lint
- status-success=Python (3.7, macos-latest)
- status-success=Python (3.9, macos-latest)
- status-success=Python (3.7, ubuntu-latest)
- status-success=Python (3.9, ubuntu-latest)
- status-success=Python (3.7, windows-latest)
- status-success=Python (3.9, windows-latest)
- status-success=Python (3.8, macos-latest)
- status-success=Python (3.11, macos-latest)
- status-success=Python (3.8, ubuntu-latest)
- status-success=Python (3.11, ubuntu-latest)
- status-success=Python (3.8, windows-latest)
- status-success=Python (3.11, windows-latest)
- "status-success=ci/circleci: build"
actions:
queue:
Expand Down
File renamed without changes.

0 comments on commit a1dc945

Please sign in to comment.