Skip to content

Commit 88d085c

Browse files
authored
Merge pull request #1 from makermelissa/master
Initial Code for Library
2 parents 3e38985 + 4241565 commit 88d085c

18 files changed

+1140
-2
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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: |
16+
echo ::set-output name=repo-name::adafruit-extended-bus
17+
- name: Set up Python 3.6
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.6
21+
- name: Versions
22+
run: |
23+
python3 --version
24+
- name: Checkout Current Repo
25+
uses: actions/checkout@v1
26+
with:
27+
submodules: true
28+
- name: Checkout tools repo
29+
uses: actions/checkout@v2
30+
with:
31+
repository: adafruit/actions-ci-circuitpython-libs
32+
path: actions-ci
33+
- name: Install dependencies
34+
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
35+
run: |
36+
source actions-ci/install.sh
37+
- name: Pip install pylint, black, & Sphinx
38+
run: |
39+
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
40+
- name: Library version
41+
run: git describe --dirty --always --tags
42+
- name: Check formatting
43+
run: |
44+
black --check --target-version=py35 .
45+
- name: PyLint
46+
run: |
47+
pylint $( find . -path './adafruit*.py' )
48+
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
49+
- name: Build docs
50+
working-directory: docs
51+
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.mpy
2+
.idea
3+
__pycache__
4+
_build
5+
*.pyc
6+
.env
7+
.python-version
8+
build*/
9+
bundles
10+
*.DS_Store
11+
.eggs
12+
dist
13+
**/*.egg-info
14+
.vscode

0 commit comments

Comments
 (0)