diff --git a/.github/workflows/macos_x86.yml b/.github/workflows/macos_x86.yml new file mode 100644 index 000000000..cafe4c0f8 --- /dev/null +++ b/.github/workflows/macos_x86.yml @@ -0,0 +1,69 @@ +# NOTE: these tests do not run the C++ +# test suite. We don't do these tests +# b/c boost from brew has proven tricky +# to work with here. +name: macOS_x86 + +on: + pull_request: + push: + branches: [main, dev] + +jobs: + test: + name: Python + runs-on: ${{ matrix.os }} + strategy: + matrix: + python: [ "3.10", "3.11" ] + os: [ macos-latest ] + rust: [1.62.1] + defaults: + run: + shell: bash + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + - name: Install cbindgen + uses: baptiste0928/cargo-install@v2 + with: + crate: cbindgen + version: "=0.24.3" + - name: Install GSL + run: | + brew install gsl + - name: Install Python dependencies + run: | + python -m venv venv + source venv/bin/activate + python -m pip install --upgrade pip + python -m pip install setuptools wheel build + python -m pip install -r requirements/development.txt + - name: Build extension module + run: | + source venv/bin/activate + cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_UNIT_TESTS=ON -DDISABLE_LTO=ON + cmake --build build -j 4 + + - name: Manualy run setuptools_scm + run: | + source venv/bin/activate + python -m setuptools_scm + + - name: Run Python tests + run: | + source venv/bin/activate + python -m pytest -n 4 tests + python -m pytest -n 2 tests_with_cpp + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 23dd89f8c..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: Tests - -on: - pull_request: - push: - branches: [main, dev] - -jobs: - test: - name: Python - runs-on: ${{ matrix.os }} - strategy: - matrix: - python: [ 3.8, 3.9, "3.10", "3.11" ] - os: [ macos-latest, ubuntu-latest ] - rust: [1.62.1] - defaults: - run: - shell: bash - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Cache conda and dependancies - id: cache - uses: actions/cache@v3 - with: - path: | - /usr/share/miniconda/envs/anaconda-client-env - ~/osx-conda - ~/.bashrc - key: ${{ runner.os }}-${{ matrix.python }}-conda-v1-${{ hashFiles('requirements/conda_minimal_deps.txt') }} - - - name: Install Conda - uses: conda-incubator/setup-miniconda@v2 - 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 - use-only-tar-bz2: true - - - 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/conda_minimal_deps_${{ runner.os }}.txt - conda install --yes --file=requirements/conda_minimal_deps.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 - - - name: Fix OSX Cache Restore - if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest' - run: | - mkdir -p /usr/local/miniconda/envs - sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env - - - name: Init conda - shell: bash -l {0} - run: | - conda init bash - - - name: Fix OSX profile - if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' - run: | - cp ~/.bash_profile ~/.bashrc - - - name: Set rust version - run: | - source ~/.bashrc - conda activate anaconda-client-env - rustup override set ${{ matrix.rust }} - - - name: rustc version - run: | - source ~/.bashrc - conda activate anaconda-client-env - rustc --version - which rustc - - - name: Install cbindgen - uses: baptiste0928/cargo-install@v2 - with: - crate: cbindgen - version: "=0.24.3" - - - name: cbindgen version - run: | - source ~/.bashrc - conda activate anaconda-client-env - cbindgen --version - which cbindgen - - - name: Build - run: | - source ~/.bashrc - conda activate anaconda-client-env - cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_CPP_UNIT_TESTS=ON -DBUILD_PYTHON_UNIT_TESTS=ON -DDISABLE_LTO=ON - cmake --build build -j 4 - - - name: Run C++ tests - run: | - source ~/.bashrc - conda activate anaconda-client-env - cmake --build build -t test - - - name: Manualy run setuptools_scm - run: | - source ~/.bashrc - conda activate anaconda-client-env - python -m setuptools_scm - - - name: Run Python tests - # shell: bash -l {0} - run: | - # conda init bash - source ~/.bashrc - conda activate anaconda-client-env - python -m pytest -n 4 tests - python -m pytest -n 2 tests_with_cpp - - - name: Build and run examples/plugin - run: | - source ~/.bashrc - conda activate anaconda-client-env - PYTHONPATH=. cmake examples/plugin - make - PYTHONPATH=. python examples/plugin/test_plugin.py - diff --git a/tests/demes-spec b/tests/demes-spec index 402bbbca1..44803a99f 160000 --- a/tests/demes-spec +++ b/tests/demes-spec @@ -1 +1 @@ -Subproject commit 402bbbca16ba9d0da520ab6b17089dc804708aae +Subproject commit 44803a99f28209560948acab1a6b4106ec2c0283