Skip to content

Commit 9df55ce

Browse files
committed
Fix workflow
1 parent 11fa46b commit 9df55ce

File tree

3 files changed

+42
-19
lines changed

3 files changed

+42
-19
lines changed

.github/actions/run-compiled/entrypoint.sh renamed to .github/actions/compile/entrypoint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ then
77
pip install "${PIP_PACKAGES[@]}"
88
fi
99

10-
git submodule update --init
11-
pip install -e .
12-
1310
echo
1411
echo "################################################################################"
1512
echo

.github/main.workflow

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
workflow "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

617
action "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

2739
action "Formatting" {
@@ -37,27 +49,30 @@ action "Formatting" {
3749
}
3850

3951
action "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

5165
action "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

6378
action "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+
113139
action "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

Comments
 (0)