Update test-and-deploy.yaml #520
Workflow file for this run
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: Scrunch package test and deploy | |
on: | |
push: | |
branches: | |
- main | |
- master | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
testpy2: | |
runs-on: ubuntu-20.04 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: | |
- 2.7 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: MatteoH2O1999/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- 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 python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox for other TOXENV | |
run: tox | |
testpy3: | |
runs-on: ubuntu-20.04 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: | |
- 3.6 | |
- 3.7 | |
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 python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox for other TOXENV | |
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 }} |