-
Notifications
You must be signed in to change notification settings - Fork 7
83 lines (73 loc) · 1.83 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
name: Scrunch package test and deploy
on:
push:
branches:
- main
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- main
- master
jobs:
test27:
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox py27
run: tox -e py27
test:
# runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
python-version:
- 3.6
- 3.7
- 3.11
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: Install dependencies
run: |
pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
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 }}