Skip to content

Fix conda_build_config.yaml #1884

Fix conda_build_config.yaml

Fix conda_build_config.yaml #1884

Workflow file for this run

name: Github Action
on: [push, pull_request]
jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Black formatting
uses: lgeiger/[email protected]
with:
args: "./"
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.email "[email protected]"
git config --global user.name "romainsacchi"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "Black reformating"
git push
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
needs: clean
steps:
- uses: actions/checkout@v2
- name: Install system dependencies for pyenv
run: |
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev \
libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev \
libncurses-dev tk-dev
- name: Install python version
uses: gabrielfalcao/pyenv-action@v18
with:
default: 3.11
command: pip install -U pip # upgrade pip after installing python
- name: create environment
run: |
pyenv install 3.11 && python -mvenv .venv390
- name: Activate pyenv Python
run: |
pyenv install -s 3.11
pyenv global 3.11
python --version
- name: Install dependencies
run: |
pip install --upgrade setuptools wheel
pip install --upgrade pip
pip install --force-reinstall setuptools
pip install -r requirements.txt --upgrade pip
pip install pytest
pip install pytest-instafail
pip install -e . --verbose
pip check
Pypi:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v2
- name: Install pypa/build
run: >-
python -m
pip install
build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
- name: Publish distribution 📦 to PyPI if Release
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
verbose: true
- name: Publish distribution 📦 to Test PyPI if Push
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true
conda:
name: (${{ matrix.python-version }}, ubuntu-latest)
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge,cmutel,konstantinstadler,haasad,pascallesage,romainsacchi
allow-softlinks: true
channel-priority: strict
auto-update-conda: true
activate-environment: test
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Publish all variants 📦 to Anaconda if Push and if master branch
if: startsWith(github.ref, 'refs/heads/master')
shell: bash -l {0}
run: |
PKG_NAME=premise
USER=romainsacchi
conda install anaconda-client
conda install conda-build
mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=~/conda-bld
export VERSION=`date +%Y.%m.%d`
# Build the package with all variants
conda build conda/ --old-build-string
# List built .tar.bz2 and .conda packages
BUILT_PACKAGES=$(find $CONDA_BLD_PATH/noarch/ -type f \( -name "*.tar.bz2" -o -name "*.conda" \))
# Upload each valid package
for PACKAGE in $BUILT_PACKAGES; do
anaconda -t ${{ secrets.ANACONDA_CLOUD }} upload -u $USER $PACKAGE --force
done
testconda:
name: (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: conda
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11",]
solver: ["classic"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge,cmutel,konstantinstadler,haasad,pascallesage,romainsacchi
allow-softlinks: true
auto-update-conda: true
activate-environment: test
conda-solver: ${{ matrix.solver }}
- name: Pull distribution 📦 from Anaconda and test it if master branch
run: |
conda install romainsacchi::premise
conda update premise
conda install bottleneck
env:
IAM_FILES_KEY: ${{ secrets.IAM_FILES_KEY }}