Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test continuous integration for Python 3.7 to 3.10 #59

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 14 additions & 92 deletions .github/workflows/conda-package-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Building Package using Conda
name: Building and publish package using anaconda

on:
push:
Expand All @@ -8,98 +8,20 @@ on:


jobs:
build:
build-and-publish:
name: ${{ matrix.os }}, Python 3.${{ matrix.python-minor-version }} for conda deployment
runs-on: ${{ matrix.os }}
strategy:
#max-parallel: 5
max-parallel: 3
matrix:
os: [ macos-latest, ubuntu-latest]
env:
- CONDA_PY: "37"
CONDA_NPY: "111"
- CONDA_PY: "38"
CONDA_NPY: "116"
- CONDA_PY: "39"
CONDA_NPY: "119"

environment: anaconda_build

os: [macos-latest, linux-latest, windows-latest]
python-minor-version: [7,8,9,10]
steps:
- uses: actions/checkout@v2

- name: Add conda to system path
run: |
# Add conda to system path
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH

- name: Setup conda
run: |
# Setup conda
sudo conda config --add channels openalea3
sudo conda config --add channels conda-forge
sudo conda config --set always_yes yes
sudo conda config --set remote_read_timeout_secs 600
sudo conda config --set auto_update_conda False
sudo conda install conda-build anaconda-client

- name: Build
env:
CONDA_PY: ${{ matrix.env.CONDA_PY }}
CONDA_NPY: ${{ matrix.env.CONDA_NPY }}
run: |
# Build
if [[ "$CONDA_PY" = "" ]]; then
echo "CONDA_PY is not defined"
exit -1
fi
if [[ "$CONDA_NPY" = "" ]]; then
echo "CONDA_NPY is not defined"
exit -1
fi
export PYTHON_VERSION=${CONDA_PY:0:1}.${CONDA_PY:1:1}
export NUMPY_VERSION=${CONDA_NPY:0:1}.${CONDA_NPY:1:2}

export BUILD_CMD="sudo conda build . --python=$PYTHON_VERSION"
export BUILD_OUTPUT=`$BUILD_CMD --output`

if [[ "$BUILD_OUTPUT" = "" ]]; then
echo "PACKAGE NAME is not defined"
exit -1
fi
echo "BUILD_OUTPUT=$BUILD_OUTPUT" >> $GITHUB_ENV

$BUILD_CMD


- name: Login
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }}
run: |
# Login
if [[ "$ANACONDA_LOGIN" = "" ]]; then
echo "ANACONDA_LOGIN is not defined"
exit -1
fi
SESSION_UID=$(uuidgen)
anaconda login --username $ANACONDA_LOGIN --password $ANACONDA_PASSWORD --hostname $SESSION_UID

- name: Deploy
env:
ANACONDA_OWNER: ${{ secrets.ANACONDA_OWNER }}
BUILD_OUTPUT: ${{ env.BUILD_OUTPUT }}
run: |
# Deploy
if [[ "$ANACONDA_OWNER" = "" ]]; then
echo "ANACONDA_OWNER is not defined"
exit -1
fi

echo "PACKAGE NAME:" $BUILD_OUTPUT
if [[ "$BUILD_OUTPUT" = "" ]]; then
echo "PACKAGE NAME is not defined"
exit -1
fi
anaconda upload --skip-existing $BUILD_OUTPUT -u $ANACONDA_OWNER --no-progress

- uses: actions/checkout@v3
- name: Build and Publish
uses: openalea/action-build-publish-anaconda@0.1.1
with:
conda: conda
python: ${{ matrix.python-minor-version }}
channels: openalea3, conda-forge
token: ${{ secrets.ANACONDA_TOKEN }}