-
Notifications
You must be signed in to change notification settings - Fork 7
93 lines (81 loc) · 2.17 KB
/
test-and-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Scrunch package test and deploy
on:
push:
branches:
- main
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
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 }}