Skip to content

mait: switch to normal ubuntu in tests #168

mait: switch to normal ubuntu in tests

mait: switch to normal ubuntu in tests #168

Workflow file for this run

# The starting point of this script are the links provided on the maturing doc:
# * https://github.com/nanoporetech/fast-ctc-decode/blob/b226ea0f2b2f4f474eff47349703d57d2ea4801b/.github/workflows/publish.yml
# * https://github.com/konstin/complex-manylinux-maturin-docker/blob/main/.github/workflows/build.yml
# Description of the usage of virtual env:
# * https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
name: test-cdshealpix
on: [push, workflow_dispatch]
# Jobs run in parallel, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobs
# Github hosted runner are: see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
jobs:
test-ubuntu-wheels:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
# Checkout the project
- name: "Checkout branch"
uses: actions/checkout@v4
# Test Rust code
#- name: Run rust wrapper tests
# run: cargo test --verbose -- --nocapture
# Set up python, see https://docs.github.com/en/actions/guides/building-and-testing-python
- name: "Set up Python ${{ matrix.python-version }} on ubuntu"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Test python code
- name: "Build and test wheel for Python ${{ matrix.python-version }} on ubuntu"
run: |
pip install virtualenv
virtualenv cdshealpixenv
source cdshealpixenv/bin/activate
# Install and use maturin
pip install --upgrade pip
pip install maturin
maturin -V
maturin develop --release
# Install dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest -v
deactivate
test-macos-wheels:
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
# Checkout the project
- name: "Checkout branch"
uses: actions/checkout@v4
# Test Rust code
#- name: Run rust wrapper tests
# run: cargo test --verbose -- --nocapture
# Set up python, see https://docs.github.com/en/actions/guides/building-and-testing-python
- name: "Set up Python ${{ matrix.python-version }} on MacOS"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Test python code
- name: "Build and test wheel for Python ${{ matrix.python-version }} on MacOS"
run: |
# Install, create and activate a python virtualenv
rustup target add x86_64-apple-darwin
pip install virtualenv
virtualenv cdshealpixenv
source cdshealpixenv/bin/activate
# Install and use maturin
pip install --upgrade pip
pip install maturin
maturin -V
maturin build --release --target universal2-apple-darwin
maturin develop --release
# Install dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest -v
deactivate
test-windows-wheels:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
# Checkout the project
- name: "Checkout branch"
uses: actions/checkout@v4
# Test Rust code
#- name: Run rust wrapper tests
# run: cargo test --verbose -- --nocapture
# Set up python, see https://docs.github.com/en/actions/guides/building-and-testing-python
- name: "Set up Python ${{ matrix.python-version }} on Windows"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Test python code
- name: "Build and test wheel for Python ${{ matrix.python-version }} on Windows"
run: |
# Install, create and activate a python virtualenv
# See: https://mothergeo-py.readthedocs.io/en/latest/development/how-to/venv-win.html
pip install virtualenv
virtualenv cdshealpixenv
.\cdshealpixenv\Scripts\activate
pip install --upgrade pip
# Install and use maturin
pip install maturin
maturin -V
maturin develop --release
# Install dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest -v
deactivate
# Build the doc and run the tests in the doc (only for python 3.12 on ubuntu)
test-doc:
runs-on: ubuntu-latest
steps:
- name: "Checkout branch"
uses: actions/checkout@v4
- name: "Set up Python 3.12 on Ubuntu"
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: "Build and test doc"
run: |
# Install virtualenv
pip install virtualenv
# Create and activate a new virtualenv
virtualenv cdshealpixenv
source cdshealpixenv/bin/activate
# Install maturin
pip install --upgrade pip
pip install maturin
sudo apt-get install pandoc
maturin -V
# Build and install cdshealpix
maturin develop --release
# Install dependencies needed to build the docs
pip install -r requirements-doc.txt
# Compile the docs and run the test examples
cd ./docs
# * Generate the HTML files
make html
# * Run the API test examples
make doctest
cd ..
# Switch of the virtualenv
deactivate