forked from yahoo/graphkit
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.16 KB
/
ci.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
name: test-n-release
on:
push:
pull_request:
release:
types: [published]
jobs:
build-n-publish:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
experimental: [false]
include:
- version: "3.12-dev"
experimental: true
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: install
run: |
python -m pip install --upgrade pip
pip install -e .[all]
- name: test
if: matrix.python-version != '3.11'
run: |
# Undo configs in setup.cfg
echo -e '[pytest]\nmarkers: slow' > pytest.ini
pytest --cov=graphtik #--log-level=DEBUG -v
- name: test-slow
if: matrix.python-version == '3.11'
run: |
pytest -m 'slow or not slow' --cov=graphtik #--log-level=DEBUG -v
- name: upload@codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
# fail_ci_if_error: true # optional (default = false)
# verbose: true # optional (default = false)
- name: build
run: |
python -m build
- name: publish@test-pypi
if: >
github.event_name == 'release' &&
matrix.python-version == '3.11' &&
github.repository_owner != 'pygraphkit'
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: publish@pypi
if: >
github.event_name == 'release' &&
matrix.python-version == '3.11' &&
github.repository_owner == 'pygraphkit'
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
password: ${{ secrets.PYPI_API_TOKEN }}