11workflow "Continuous Integration" {
22 on = " push"
3- resolves = [" Coverage" ]
3+ resolves = [" Coverage" , " Documentation" , " Formatting" , " Linters" ]
4+ }
5+
6+ action "Compile" {
7+ uses = " ./.github/actions/compile"
8+ args = [
9+ " git submodule update --init" ,
10+ " pip install -e ."
11+ ]
12+ env = {
13+ PYTHON_VERSION = " 3.7"
14+ }
415}
516
617action "Documentation" {
7- uses = " ./.github/ actions/run-compiled "
18+ uses = " swillner/ actions/python-run@master "
819 args = [
20+ " pip install -e ." ,
921 " sphinx-build -M html docs docs/build -qW" , # treat warnings as errors (-W)...
1022 " sphinx-build -M html docs docs/build -Eqn -b coverage" , # ...but not when being nitpicky (-n)
1123 " if [[ -s docs/build/html/python.txt ]]" ,
@@ -21,7 +33,7 @@ action "Documentation" {
2133 PYTHON_VERSION = " 3.7"
2234 PIP_PACKAGES = " sphinx>=1.8 sphinx_rtd_theme"
2335 }
24- needs = [" Formatting " , " Linters " ]
36+ needs = [" Compile " ]
2537}
2638
2739action "Formatting" {
@@ -37,27 +49,30 @@ action "Formatting" {
3749}
3850
3951action "Linters" {
40- uses = " ./.github/ actions/run-compiled "
52+ uses = " swillner/ actions/python-run@master "
4153 args = [
54+ " pip install -e ." ,
4255 " flake8 pyhector tests setup.py" ,
4356 " pylint pyhector"
4457 ]
4558 env = {
4659 PYTHON_VERSION = " 3.7"
4760 PIP_PACKAGES = " flake8 pylint"
4861 }
62+ needs = [" Compile" ]
4963}
5064
5165action "Tests" {
52- uses = " ./.github/ actions/run-compiled "
66+ uses = " swillner/ actions/python-run@master "
5367 args = [
68+ " pip install -e ." ,
5469 " pytest tests -r a --cov=pyhector --cov-report=''" ,
5570 ]
5671 env = {
5772 PYTHON_VERSION = " 3.7"
5873 PIP_PACKAGES = " pytest pytest-cov"
5974 }
60- needs = [" Documentation " ]
75+ needs = [" Compile " ]
6176}
6277
6378action "Coverage" {
@@ -89,15 +104,11 @@ action "Filter tag" {
89104 args = " tag 'v*'"
90105}
91106
92- action "Filter master branch" {
93- uses = " swillner/actions/filter-branch@master"
94- args = " master"
95- needs = " Filter tag"
96- }
97-
98- action "Publish on PyPi" {
99- uses = " ./.github/actions/run-compiled"
107+ action "Publish on PyPI" {
108+ uses = " ./.github/actions/compile"
100109 args = [
110+ " git submodule update --init" ,
111+ " pip install -e ." ,
101112 " rm -rf build dist" ,
102113 " python setup.py sdist" ,
103114 " twine upload dist/*"
@@ -106,12 +117,27 @@ action "Publish on PyPi" {
106117 PYTHON_VERSION = " 3.7"
107118 PIP_PACKAGES = " twine"
108119 }
109- needs = [" Filter master branch " ]
120+ needs = [" Filter tag " ]
110121 secrets = [" TWINE_USERNAME" , " TWINE_PASSWORD" ]
111122}
112123
124+ action "Test PyPI install" {
125+ uses = " ./.github/actions/compile"
126+ args = [
127+ " sleep 15" ,
128+ " mkdir tmp" ,
129+ " cd tmp" ,
130+ " pip install pyhector" ,
131+ " python -c 'import pyhector'"
132+ ]
133+ env = {
134+ PYTHON_VERSION = " 3.7"
135+ }
136+ needs = [" Publish on PyPI" ]
137+ }
138+
113139action "Create release" {
114140 uses = " swillner/actions/create-release@master"
115- needs = [" Publish on PyPi " ]
141+ needs = [" Test PyPI install " ]
116142 secrets = [" GITHUB_TOKEN" ]
117143}
0 commit comments