Skip to content

Commit

Permalink
test linux64 ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Oct 20, 2023
1 parent 5d3860f commit 1f3f965
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 181 deletions.
53 changes: 5 additions & 48 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
MATURIN_PASSWORD: ${{ secrets.PYPI_PASSWORD_FXP }}
run: |
source $HOME/.cargo/env
for PYBIN in /opt/python/cp3[78910]*/bin; do
for PYBIN in /opt/python/cp3{8,9,10,11,12}-*/bin; do
"${PYBIN}/pip" install --upgrade pip
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" -V
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
${{ env.img }} \
bash -exc 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env && \
for PYBIN in /opt/python/cp3[8910]*/bin; do
for PYBIN in /opt/python/cp3{8,9,10,11,12}-*/bin; do
echo "Loop on PYBIN: $PYBIN"
"${PYBIN}/pip" install --upgrade pip
"${PYBIN}/pip" install maturin
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
${{ env.img }} \
bash -exc 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host aarch64-unknown-linux-gnu -y && \
source $HOME/.cargo/env && \
for PYBIN in /opt/python/cp3[78910]*/bin; do
for PYBIN in /opt/python/cp3{8,9,10,11,12}-*/bin; do
echo "Loop on PYBIN: $PYBIN"
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" -V
Expand All @@ -165,7 +165,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
# Checkout the project
- uses: actions/checkout@v3
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
# Checkout the project
- uses: actions/checkout@v3
Expand All @@ -227,46 +227,3 @@ jobs:
echo "${PYBIN}/python"
maturin publish --interpreter python${{matrix.python_version}} --no-sdist --universal2 --skip-existing --username "$MATURIN_USERNAME"
maturin publish --interpreter python${{matrix.python_version}} --no-sdist --skip-existing --username "$MATURIN_USERNAME"
# See e.g.: https://blog.flozz.fr/2020/09/21/deployer-automatiquement-sur-github-pages-avec-github-actions/
# using: https://github.com/JamesIves/github-pages-deploy-action
deploy-doc:
runs-on: ubuntu-latest
steps:
- name: "Checkout branch ${{ github.head_ref }}"
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: "Set up Python 3.9 on Ubuntu"
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: "Build doc"
run: |
# Build the doc
# - Install virtualenv
pip install --upgrade pip
pip install virtualenv
# - Create and activate a new virtualenv
virtualenv cdshealpixenv
source cdshealpixenv/bin/activate
pip install --upgrade pip
# - Install maturin
pip install maturin
# - Build and install cdshealpix
maturin develop --release
# - Install dependencies needed to run benches
pip install -r requirements-doc.txt
# - Build the doc: once done, it is in docs/_build/html/
cd ./docs
make html
cd ..
# Switch of the virtualenv
deactivate
- name: "Publish doc on github pages (commit on branch gh-pages)"
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/_build/html/

150 changes: 17 additions & 133 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,156 +13,40 @@ 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:

# Linux is specific because of manylinux, we have to use a docker file
test-linux64-wheels:
# Containers run in Linux
runs-on: ubuntu-latest
# Docker Hub image that 'build-linux-wheels' executes in.
# See https://github.com/pypa/manylinux for this particular container:
# * CPython 3.8, 3.9, 3.10, ... installed in /opt/python/<python tag>-<abi tag>
# * CPython 3.8, 3.9, ... installed in /opt/python/<python tag>-<abi tag>
container: quay.io/pypa/manylinux2014_x86_64
# We are now in CentOS 7 64 bits
steps:
# Checkout the project
- name: "Checkout branch ${{ github.head_ref }}"
- name: "Checkout the full project"
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
# We need to install rust in the docker image (else, cargo is already available in github action)
# We need to install rust in the docker image (else, cargo is already available in github action)
- name: "Install Rust"
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Test Rust code
#- name: Run rust wrapper tests
# run: |
# source $HOME/.cargo/env
# cargo test --verbose -- --nocapture
# Build and install locally wheels for all pre-installed python version (in /opt/python/, see docker image comment)
# Build wheels for all pre-installed python version (in /opt/python/, see docker image comment)
# installing first maturin and using maturin: https://github.com/PyO3/maturin#pypy
- name: "Build and test wheels"
# For secrets, see https://docs.github.com/en/actions/reference/encrypted-secrets
- name: "Build and run tests"
shell: bash
run: |
source $HOME/.cargo/env
for PYBIN in /opt/python/cp3[8910]*/bin; do
echo "Loop on PYBIN: $PYBIN"
# With maturin develop, we have to use virtualenv
"${PYBIN}/pip" install virtualenv
"${PYBIN}/virtualenv" cdshealpixenv
source cdshealpixenv/bin/activate
# No we are in the virtual env
pip install --upgrade pip
echo "INSTALL MATURIN"
pip install maturin
maturin -V
echo "MATURIN BUILD"
maturin build --release --compatibility manylinux2014
echo "MATURIN DEVELOP"
maturin develop --release
echo "INSTALL DEPENDENCIES"
pip install -r requirements-dev.txt
echo "PERFORM TESTS"
cd python
python -m pytest -v -s cdshealpix/tests/test_nested_healpix.py
python -m pytest -v -s cdshealpix/tests/test_ring_healpix.py
cd ..
echo "CLEAN"
pip freeze > requirements-uninstall.txt
pip uninstall -r requirements-uninstall.txt -y
deactivate
rm -r cdshealpixenv/
for PYBIN in /opt/python/cp3{8,9,10,11,12}-*/bin; do
"${PYBIN}/pip" install --upgrade pip
"${PYBIN}/pip" install maturin
"${PYBIN}/maturin" -V
rustc -vV
echo "${PYBIN}/python"
"${PYBIN}/maturin" develop --release
"${PYBIN}/pip" install -r requirements-dev.txt
"${PYBIN}/pytest" python/cdshealpix/tests/test_nested_healpix.py
"${PYBIN}/pytest" python/cdshealpix/tests/test_ring_healpix.py
done
# # Linux is specific because of manylinux, we have to use a docker file
# test-linux32-wheels:
# # Containers run in Linux
# runs-on: ubuntu-latest
# # Docker Hub image that 'build-linux-wheels' executes in.
# # See https://github.com/pypa/manylinux for this particular container:
# # * CPython 3.8, 3.9, 3.10 ... installed in /opt/python/<python tag>-<abi tag>
# container: quay.io/pypa/manylinux2014_i686
# # We are now in CentOS 7 32 bits
# steps:
# # Checkout the project
# - name: "Checkout branch ${{ github.head_ref }}"
# uses: actions/checkout@v3
# # We need to install rust in the docker image (else, cargo is already available in github action)
# - name: "Install Rust"
# run: |
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host i686-unknown-linux-gnu -y
# # Test Rust code
# #- name: Run rust wrapper tests
# # run: |
# # source $HOME/.cargo/env
# # cargo test --verbose -- --nocapture
# # Build wheels for all pre-installed python version (in /opt/python/, see docker image comment)
# # installing first maturin and using maturin: https://github.com/PyO3/maturin#pypy
# - name: "Build and test wheels"
# run: |
# source $HOME/.cargo/env
# for PYBIN in /opt/python/cp3[8910]*/bin; do
# echo "Loop on PYBIN: $PYBIN"
# # With maturin develop, we have to use virtualenv
# "${PYBIN}/pip" install virtualenv
# "${PYBIN}/virtualenv" cdshealpixenv
# source cdshealpixenv/bin/activate
# pip install --upgrade pip
# # No we are in the virtual env
# echo "INSTALL MATURIN"
# pip install maturin
# maturin -V
# echo "MATURIN DEVELOP"
# maturin build --release --compatibility manylinux2014 --target i686-unknown-linux-gnu
# echo "MATURIN DEVELOP"
# maturin develop --release --target i686-unknown-linux-gnu
# echo "INSTALL DEPENDENCIES"
# pip install -r requirements-dev.txt
# echo "PERFORM TESTS"
# python -m pytest -v -s cdshealpix/tests/test_nested_healpix.py
# python -m pytest -v -s cdshealpix/tests/test_ring_healpix.py
# echo "CLEAN"
# pip freeze > requirements-uninstall.txt
# pip uninstall -r requirements-uninstall.txt -y
# deactivate
# rm -r cdshealpixenv/
# done

test-linux32-wheels:
runs-on: ubuntu-latest
env:
img: quay.io/pypa/manylinux2014_i686
steps:
- name: Checkout
uses: actions/checkout@v3
- name: "Set up QEMU"
id: qemu
uses: docker/setup-qemu-action@v1
- name: Install dependencies
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} \
bash -exc 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env && \
for PYBIN in /opt/python/cp3[78910]*/bin; do
echo "Loop on PYBIN: $PYBIN"
"${PYBIN}/pip" install virtualenv
"${PYBIN}/virtualenv" cdshealpixenv
source cdshealpixenv/bin/activate
pip install --upgrade pip
pip install maturin
maturin build --release --compatibility manylinux2014
maturin develop --release
pip install -r requirements-dev.txt
cd python
python -m pytest -v -s cdshealpix/tests/test_nested_healpix.py
python -m pytest -v -s cdshealpix/tests/test_ring_healpix.py
cd ..
pip freeze > requirements-uninstall.txt
pip uninstall -r requirements-uninstall.txt -y
deactivate
rm -r cdshealpixenv/
done'
## So far desactivated because too long to build astropy wheels
#test-aarch64-wheels:
# runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ astropy<5.3; python_version == '3.8'
astropy; python_version > '3.8'
pre-commit==2.21.*
pytest
astropy_healpix

0 comments on commit 1f3f965

Please sign in to comment.