Skip to content

Merge pull request #444 from Crunch-io/fix-progress-complete #338

Merge pull request #444 from Crunch-io/fix-progress-complete

Merge pull request #444 from Crunch-io/fix-progress-complete #338

name: Scrunch package test and deploy
on:
push:
branches:
- main
- master
tags:
- '**'
pull_request:
branches:
- main
- master
jobs:
test:
# runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
python-version:
- 2.7
- 3.6
- 3.7
include:
- os: "ubuntu-latest"
# There is no build for Python 3.6 in ubuntu>20.04.
# This include can be removed when we drop support for Python 3.6.
- os: "ubuntu-20.04"
python-version: "3.6"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies python different from 3.4
if: matrix.python-version != '3.4'
run: |
pip install --upgrade pip
pip install tox tox-gh-actions
- name: Install dependencies for python 3.4
if: matrix.python-version == '3.4'
run: |
pip install --upgrade pip
pip install tox
- name: Test with tox for TOXENV py34
if: matrix.python-version == '3.4'
env:
TOXENV: py34
run: tox
- name: Test with tox for other TOXENV
if: matrix.python-version != '3.4'
run: tox
deploy:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 50
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Build sdist and dist_wheels
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish scrunch to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.DEPLOY_TOKEN }}