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

Use GitHub Actions & Pytest #45

Merged
merged 8 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from 7 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
28 changes: 0 additions & 28 deletions .appveyor.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: build

on:
pull_request:
push:
branches:
- master
tags:
- '*'

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, macos-10.15, windows-2019 ]
python-version: [ 3.6, 3.7, 3.8, 3.9 ]

env:
RUNNER_OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

steps:
- uses: actions/checkout@v2
- name: Set Additional Envs
run: |
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
echo "DEPLOY_PYPI_SOURCE=$( [[ $PYTHON_VERSION == 3.8 && $RUNNER_OS == 'macos'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,anaconda
- name: Install
# scipy and numpy versions are chosen to match cvxpy
run: |
if [[ "$PYTHON_VERSION" == "3.6" ]] || [[ "$PYTHON_VERSION" == "3.7" ]] || [[ "$PYTHON_VERSION" == "3.8" ]]; then
conda install scipy=1.3 numpy=1.16 mkl cvxpy scs pytest
elif [[ "$PYTHON_VERSION" == "3.9" ]]; then
conda install scipy=1.5 numpy=1.19 mkl cvxpy scs pytest
fi
python setup.py install

- name: Test
run: |
pytest

- name: Build wheels
if: ${{env.DEPLOY == 'True'}}
env:
CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
CIBW_SKIP: "*-win32 *-manylinux_i686"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24
uses: joerick/[email protected]

- name: Build source
if: ${{env.DEPLOY == 'True' && env.DEPLOY_PYPI_SOURCE == 'True'}}
run: |
python setup.py sdist --dist-dir=wheelhouse

- name: Release to pypi
if: ${{env.DEPLOY == 'True'}}
run: |
python -m pip install --upgrade twine
twine check wheelhouse/*
twine upload --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD

- name: Upload artifacts to github
if: ${{env.DEPLOY == 'True'}}
uses: actions/upload-artifact@v1
with:
name: wheels
path: ./wheelhouse
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build Status](https://travis-ci.org/cvxgrp/diffcp.svg?branch=master)](https://travis-ci.org/cvxgrp/diffcp)
[![Build status](https://ci.appveyor.com/api/projects/status/ctrw6bij02ptsn0t/branch/master?svg=true)](https://ci.appveyor.com/project/sbarratt/diffcp/branch/master)
[![Build Status](http://github.com/cvxgrp/diffcp/workflows/build/badge.svg?event=push)](https://github.com/cvxgrp/diffcp/actions/workflows/build.yml)

# diffcp

Expand Down
Loading