Skip to content

Commit

Permalink
Start CI migration to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
iosonofabio committed Jul 11, 2022
1 parent e23454b commit 6bf8ac5
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 5 deletions.
File renamed without changes.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and test, upload to PyPI on release

on: [push, pull_request]
env:
CIBW_TEST_COMMAND: "cd {project} && python -m pytest tests"
CIBW_TEST_EXTRAS: "test"
CIBW_SKIP: "*musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014"

jobs:
build_linux:
name: Build on Linux (${{ matrix.wheel_arch }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'

- name: Install deps
run: .install_deps.sh

- name: Build
run: .install.sh

- name: Test
run: .test.sh

build_macos:
name: Build wheels on macOS (${{ matrix.wheel_arch }})
runs-on: macos-10.15

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'

- name: Install deps
run: .install_deps.sh

- name: Build
run: .install.sh

- name: Test
run: .test.sh
2 changes: 1 addition & 1 deletion .travis_install.sh → .install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if [ $TRAVIS_OS_NAME == 'osx' ]; then
export PATH="$HOME/miniconda/bin:$PATH"
source $HOME/miniconda/bin/activate
conda activate travis
conda activate ci
fi

# We do not need to actually install anything when deploying because
Expand Down
7 changes: 4 additions & 3 deletions .travis_before_install.sh → .install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
echo "Prepare interpreter"
if [ $TRAVIS_OS_NAME == 'linux' ]; then
echo "Installing deps for linux"
# NOTE: leidenalg installs igraph (in a somewhat messy way for now)
echo "... none for now"
# NOTE: leidenalg installs igraph (in a somewhat messy way for now
#sudo add-apt-repository -y ppa:igraph/ppa
#sudo apt-get -qq update
#sudo apt-get install igraph
Expand All @@ -23,8 +24,8 @@ elif [ $TRAVIS_OS_NAME == 'osx' ]; then
source $HOME/miniconda/bin/activate

# Make conda environment and activate
conda create -y -n travis python=$CONDA_PY
conda activate travis
conda create -y -n ci python=$CONDA_PY
conda activate ci

# Use pip from conda
conda install -y pip
Expand Down
2 changes: 1 addition & 1 deletion .travis_test.sh → .test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if [ "$TRAVIS_OS_NAME" == 'osx' ]; then
export PATH="$HOME/miniconda/bin:$PATH"
source $HOME/miniconda/bin/activate
conda activate travis
conda activate ci
PYTHON=$(which python)
PYTEST=$(which pytest)
else
Expand Down

0 comments on commit 6bf8ac5

Please sign in to comment.