Skip to content

Commit 7c6238c

Browse files
authored
✅ Balerion HotFix for Release Build Workflow (#140)
* ✅ Modify Pull Request Workflow for Shorter Build times - Reduce MacOS and Windows to only run integration tests. - Add make file to run all integration tests * 🐛 Release Build CI Fixes - Simplify commands for CI - Add test pypi commands for CI for easy flipping - Add noshow to stop existing issue - Add release commands * 🐛 Add atomic writes for windows * 🆙 Update Version to v1.1.1
1 parent 39b0366 commit 7c6238c

File tree

6 files changed

+114
-124
lines changed

6 files changed

+114
-124
lines changed

.github/workflows/pull_request.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: make environment
4848
- name: Install Module
4949
run: make install validate
50-
- name: Test
50+
- name: Full Test & Coverage
5151
run: make coverage
5252

5353
mac_check:
@@ -66,8 +66,8 @@ jobs:
6666
run: make environment
6767
- name: Install Module
6868
run: make install validate
69-
- name: Test
70-
run: make coverage
69+
- name: Integration Tests
70+
run: make test-integration
7171

7272
windows_check:
7373
name: Windows Check
@@ -87,6 +87,5 @@ jobs:
8787
run: make environment
8888
- name: Install Module
8989
run: make install validate
90-
- name: Test
91-
continue-on-error: true #TODO Remove Window tests bypass
92-
run: make test
90+
- name: Integration Tests
91+
run: make test-integration

.github/workflows/release.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: make environment
5050
- name: Install Module
5151
run: make install validate
52-
- name: Test
52+
- name: Full Test & Coverage
5353
run: make coverage
5454

5555
mac_check:
@@ -68,8 +68,8 @@ jobs:
6868
run: make environment
6969
- name: Install Module
7070
run: make install validate
71-
- name: Test
72-
run: make coverage
71+
- name: Integration Tests
72+
run: make test-integration
7373

7474
windows_check:
7575
name: Windows Check
@@ -89,9 +89,8 @@ jobs:
8989
run: make environment
9090
- name: Install Module
9191
run: make install validate
92-
- name: Test
93-
continue-on-error: true #TODO Remove Window tests bypass
94-
run: make test
92+
- name: Integration Tests
93+
run: make test-integration
9594

9695
release:
9796
name: Release
@@ -118,6 +117,13 @@ jobs:
118117
release_name: Release ${{ env.PACKAGE_VERSION }}
119118
draft: false
120119
prerelease: false
120+
- name: Dependency Graph
121+
run: make dependency-graph-ci
122+
- name: Upload Dependency Graph as Artifact
123+
uses: actions/upload-artifact@v2
124+
with:
125+
name: dependency-graph
126+
path: dependency-graph.svg
121127
- name: Package
122128
run: make package
123129
- name: Upload Package as Artifact
@@ -126,26 +132,14 @@ jobs:
126132
name: package
127133
path: dist/
128134
- name: Upload Package to PyPi
129-
run: |
130-
python -m pip install --user --upgrade twine
131-
python -m twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*
135+
env:
136+
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
137+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
138+
run: make package-upload-ci
132139
- name: Validate Import
133140
run: make package-validate
134-
- name: Dependency Graph
135-
run: |
136-
sudo apt install graphviz
137-
pip install pydeps
138-
pydeps --max-bacon 2 -o dependency-graph.svg src/electionguard
139-
- name: Upload Dependency Graph as Artifact
140-
uses: actions/upload-artifact@v2
141-
with:
142-
name: dependency-graph
143-
path: dependency-graph.svg
144141
- name: Zip Artifacts
145-
run: |
146-
mv dist electionguard
147-
mv dependency-graph.svg electionguard
148-
zip -r electionguard.zip electionguard
142+
run: make release-zip-ci
149143
- name: Add Artifacts to Release
150144
id: upload-release-asset_1
151145
uses: actions/[email protected]
@@ -157,6 +151,4 @@ jobs:
157151
asset_name: electionguard.zip
158152
asset_content_type: application/zip
159153
- name: Deploy Github Pages
160-
run: |
161-
pip install mkdocs
162-
mkdocs gh-deploy --force
154+
run: make docs-deploy-ci

Makefile

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ test-example:
8989
@echo ✅ TEST Example
9090
pipenv run python -m pytest -s tests/integration/test_end_to_end_election.py
9191

92+
test-integration:
93+
@echo ✅ INTEGRATION TESTS
94+
pipenv run pytest tests/integration
95+
9296
# Coverage
9397
coverage:
9498
@echo ✅ COVERAGE
@@ -115,8 +119,18 @@ docs-deploy:
115119
@echo 🚀 DEPLOY to Github Pages
116120
pipenv run mkdocs gh-deploy --force
117121

122+
docs-deploy-ci:
123+
@echo 🚀 DEPLOY to Github Pages
124+
pip install mkdocs
125+
mkdocs gh-deploy --force
126+
118127
dependency-graph:
119-
pipenv run pydeps --max-bacon 2 -o dependency-graph.svg src/electionguard
128+
pipenv run pydeps --noshow --max-bacon 2 -o dependency-graph.svg src/electionguard
129+
130+
dependency-graph-ci:
131+
sudo apt install graphviz
132+
pip install pydeps
133+
pydeps --noshow --max-bacon 2 -o dependency-graph.svg src/electionguard
120134

121135
# Sample Data
122136
generate-sample-data:
@@ -130,20 +144,34 @@ package:
130144
python setup.py sdist bdist_wheel
131145

132146
package-upload:
133-
python3 -m pip install --user --upgrade twine
147+
python -m pip install --user --upgrade twine
134148
python -m twine upload dist/*
135149

150+
package-upload-ci:
151+
python -m pip install --user --upgrade twine
152+
python -m twine upload --username __token__ --password $(PYPI_TOKEN) dist/*
153+
136154
package-upload-test:
137-
python3 -m pip install --user --upgrade twine
155+
python -m pip install --user --upgrade twine
138156
python -m twine upload --repository testpypi dist/*
139157

158+
package-upload-test-ci:
159+
python -m pip install --user --upgrade twine
160+
python -m twine upload --repository testpypi --username __token__ --password $(TEST_PYPI_TOKEN) dist/*
161+
140162
package-validate:
141163
@echo ✅ VALIDATE
142164
python -m pip install --no-deps electionguard
143165
python -c 'import electionguard'
144166

145-
146167
package-validate-test:
147168
@echo ✅ VALIDATE
148169
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps electionguard
149170
python -c 'import electionguard'
171+
172+
# Release
173+
release-zip-ci:
174+
@echo 📁 ZIP RELEASE ARTIFACTS
175+
mv dist electionguard
176+
mv dependency-graph.svg electionguard
177+
zip -r electionguard.zip electionguard

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
atomicwrites = "*"
78
black = "*"
89
coverage = "*"
910
docutils = "*"

0 commit comments

Comments
 (0)