Merge pull request #191 from dcajasn/dcajasn-patch-1 #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- 'release/**' | |
tags: | |
- '*' | |
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | |
# Only cancels-in-progress on PRs (head_ref only defined in PR, fallback run_id always unique) | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
linters: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
# with: | |
# python-version: 3.8 | |
- run: pip install -r requirements.txt | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-20.04, macos-11, windows-2022 ] | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11"] | |
# include: | |
# - os: ubuntu-20.04 | |
# python-version: 3.8 | |
# openmp: "True" | |
# - os: ubuntu-20.04 | |
# python-version: 3.8 | |
# - os: macos-11 | |
# python-version: 3.8 | |
# single_action_config: "True" | |
# - os: windows-2022 | |
# python-version: 3.8 | |
env: | |
RUNNER_OS: ${{ matrix.os }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' && 'True' || 'False' }}" | |
USE_OPENMP: "${{ matrix.openmp == 'True' && 'True' || 'False' }}" | |
MOSEK_CI_BASE64: ${{ secrets.MOSEK_CI_BASE64 }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set Additional Envs | |
run: | | |
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV | |
echo $MOSEK_CI_BASE64 | base64 -d > mosek.lic | |
echo "MOSEKLM_LICENSE_FILE=$( [[ $RUNNER_OS == 'macOS' ]] && echo $(pwd)/mosek.lic || echo $(realpath mosek.lic) )" >> $GITHUB_ENV | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge,anaconda | |
- name: Install | |
run: | | |
source continuous_integration/install_dependencies.sh | |
# - name: Test | |
# run: | | |
# source continuous_integration/test_script.sh | |
- name: Upload coverage file | |
uses: actions/upload-artifact@v2 | |
if: ${{env.SINGLE_ACTION_CONFIG == 'True'}} | |
with: | |
name: coverage | |
path: coverage.xml | |
build_wheels: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-20.04, macos-11, windows-2022 ] | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11"] | |
# include: | |
# - os: ubuntu-20.04 | |
# python-version: 3.8 | |
# - os: macos-11 | |
# python-version: 3.8 | |
# single_action_config: "True" | |
# - os: windows-2022 | |
# python-version: 3.8 | |
env: | |
RUNNER_OS: ${{ matrix.os }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}" | |
PYPI_SERVER: ${{ secrets.PYPI_SERVER }} | |
PYPI_USER: ${{ secrets.PYPI_USER }} | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set Additional Envs | |
shell: bash | |
run: | | |
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV | |
echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV | |
- name: Build wheels | |
if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}} | |
env: | |
CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*" | |
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" | |
CIBW_ARCHS_MACOS: x86_64 universal2 | |
uses: joerick/[email protected] | |
- name: Build source | |
if: ${{github.event_name == 'push' && env.SINGLE_ACTION_CONFIG == 'True'}} | |
run: | | |
python setup.py sdist --dist-dir=wheelhouse | |
- name: Check wheels | |
if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}} | |
shell: bash | |
run: | | |
python -m pip install --upgrade twine | |
twine check wheelhouse/* | |
- name: Release to pypi | |
if: ${{env.DEPLOY == 'True' && env.USE_OPENMP != 'True'}} | |
shell: bash | |
run: | | |
twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD | |
- name: Upload artifacts to github | |
if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}} | |
uses: actions/upload-artifact@v1 | |
with: | |
name: wheels | |
path: ./wheelhouse |