Skip to content

Commit 52233a4

Browse files
authored
Merge pull request #71 from makermelissa/master
Black formatted, Pylinted, Documentified, and Github Actionified
2 parents 7143038 + 29b9998 commit 52233a4

File tree

19 files changed

+1115
-424
lines changed

19 files changed

+1115
-424
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build CI
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Dump GitHub context
10+
env:
11+
GITHUB_CONTEXT: ${{ toJson(github) }}
12+
run: echo "$GITHUB_CONTEXT"
13+
- name: Translate Repo Name For Build Tools filename_prefix
14+
id: repo-name
15+
run: echo ::set-output name=repo-name::Adafruit-PlatformDetect
16+
- name: Set up Python 3.6
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.6
20+
- name: Versions
21+
run: |
22+
python3 --version
23+
- name: Checkout Current Repo
24+
uses: actions/checkout@v1
25+
with:
26+
submodules: true
27+
- name: Checkout tools repo
28+
uses: actions/checkout@v2
29+
with:
30+
repository: adafruit/actions-ci-circuitpython-libs
31+
path: actions-ci
32+
- name: Install dependencies
33+
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
34+
run: |
35+
source actions-ci/install.sh
36+
- name: Pip install pylint, black, & Sphinx
37+
run: |
38+
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
39+
- name: Library version
40+
run: git describe --dirty --always --tags
41+
- name: Check formatting
42+
run: |
43+
black --check --target-version=py35 .
44+
- name: PyLint
45+
run: |
46+
pylint $( find . -path './adafruit*.py' )
47+
- name: Build docs
48+
working-directory: docs
49+
run: sphinx-build -E -W -b html . _build/html

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release Actions
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload-pypi:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Check For setup.py
13+
id: need-pypi
14+
run: |
15+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
16+
- name: Set up Python
17+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install setuptools wheel twine
26+
- name: Build and publish
27+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
28+
env:
29+
TWINE_USERNAME: ${{ secrets.pypi_username }}
30+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
31+
run: |
32+
python setup.py sdist
33+
twine upload dist/*

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ __pycache__
44
_build
55
*.pyc
66
.env
7-
build*
87
bundles
98
*.DS_Store
109
.eggs
1110
dist
12-
**/*.egg-info
11+
**/*.egg-info

0 commit comments

Comments
 (0)