Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Commit 05123f7

Browse files
committed
actions
1 parent 0f0fa1f commit 05123f7

File tree

4 files changed

+280
-0
lines changed

4 files changed

+280
-0
lines changed

.github/workflows/main.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
update-requirements:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Python 3.8
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
18+
- name: Update requirements file
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install pipenv-to-requirements
22+
pipenv_to_requirements
23+
24+
- name: Check in requirements.txt and requirements-dev.txt
25+
run: |
26+
git add requirements*.txt
27+
if [[ ! -z $(git status -s requirements*.txt) ]]
28+
then
29+
git config --local user.email "action@github.com"
30+
git config --local user.name "GitHub Action"
31+
git commit -m 'Automatically generated requirements.txt and requirements-dev.txt' requirements*.txt
32+
git push
33+
fi
34+
35+
unittests:
36+
needs: update-requirements
37+
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
python-version: [3.7.1, 3.8, 3.9]
41+
42+
steps:
43+
- uses: actions/checkout@v2
44+
45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: actions/setup-python@v2
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
- name: Install pipenv
50+
uses: dschep/install-pipenv-action@v1
51+
- name: Install dependencies and run
52+
run: |
53+
pipenv install --dev
54+
pipenv run python -m unittest
55+
56+
update-outputs:
57+
needs: unittests
58+
runs-on: ubuntu-latest
59+
steps:
60+
- if: ${{ matrix.python-version == '3.9' }}
61+
run: |
62+
find tests -name output -exec git add --force {} \;
63+
if [[ ! -z $(git status -s tests) ]]
64+
then
65+
git config --local user.email "action@github.com"
66+
git config --local user.name "GitHub Action"
67+
git commit -m 'Automated adding outputs from tests' tests
68+
git push
69+
fi

.github/workflows/pr-test.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Pull request unit tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python 3.8
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
- name: Install pipenv
18+
uses: dschep/install-pipenv-action@v1
19+
- name: Install dependencies and test
20+
run: |
21+
pipenv install --dev
22+
pipenv run python -m unittest
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-n-publish:
9+
name: Build and publish Python 🐍 distributions 📦 to PyPI
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.8
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install wheel
24+
25+
- name: build a binary wheel dist
26+
run: |
27+
rm -fr dist
28+
python setup.py bdist_wheel sdist
29+
30+
- name: Publish distribution 📦 to PyPI
31+
uses: pypa/gh-action-pypi-publish@v1.2.2
32+
with:
33+
user: __token__
34+
password: ${{ secrets.pypi_password }}
35+
36+
- name: Update metadata
37+
run: |
38+
git add AUTHORS ChangeLog
39+
if [[ ! -z $(git status -s AUTHORS ChangeLog) ]]
40+
then
41+
git config --local user.email "action@github.com"
42+
git config --local user.name "GitHub Action"
43+
git commit -m 'PBR AUTHORS and ChangeLog update' AUTHORS ChangeLog
44+
git push
45+
fi
46+
47+

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# Specific to this project
132+
temp/
133+
output/
134+
135+
# Test config
136+
tests/test_config.ini
137+
138+
# Don't lock
139+
Pipfile.lock
140+
141+
# No Pycharm
142+
.idea/

0 commit comments

Comments
 (0)