Skip to content

Commit 84a72ad

Browse files
committed
Switched from Travis to GitHub Actions
1 parent 2190737 commit 84a72ad

File tree

5 files changed

+119
-35
lines changed

5 files changed

+119
-35
lines changed

.github/workflows/build.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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::$(
17+
echo ${{ github.repository }} |
18+
awk -F '\/' '{ print tolower($2) }' |
19+
tr '_' '-'
20+
)
21+
- name: Set up Python 3.6
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: 3.6
25+
- name: Versions
26+
run: |
27+
python3 --version
28+
- uses: actions/checkout@v1
29+
with:
30+
submodules: true
31+
- name: Install deps
32+
run: |
33+
sudo apt-get install -y gettext
34+
pip install -r requirements.txt
35+
pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
36+
pip install --force-reinstall pylint==1.9.2
37+
- name: Library version
38+
run: git describe --dirty --always --tags
39+
- name: PyLint
40+
run: |
41+
pylint $( find . -path './adafruit*.py' )
42+
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
43+
- name: Build assets
44+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
45+
- name: Build docs
46+
working-directory: docs
47+
run: sphinx-build -E -W -b html . _build/html

.github/workflows/release.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release Actions
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload-release-assets:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Dump GitHub context
12+
env:
13+
GITHUB_CONTEXT: ${{ toJson(github) }}
14+
run: echo "$GITHUB_CONTEXT"
15+
- name: Translate Repo Name For Build Tools filename_prefix
16+
id: repo-name
17+
run: |
18+
echo ::set-output name=repo-name::$(
19+
echo ${{ github.repository }} |
20+
awk -F '\/' '{ print tolower($2) }' |
21+
tr '_' '-'
22+
)
23+
- name: Set up Python 3.6
24+
uses: actions/setup-python@v1
25+
with:
26+
python-version: 3.6
27+
- name: Versions
28+
run: |
29+
python3 --version
30+
- uses: actions/checkout@v1
31+
with:
32+
submodules: true
33+
- name: Install deps
34+
run: |
35+
sudo apt-get install -y gettext
36+
pip install -r requirements.txt
37+
pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
38+
- name: Build assets
39+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
40+
- name: Upload Release Assets
41+
# the 'official' actions version does not yet support dynamically
42+
# supplying asset names to upload. @csexton's version chosen based on
43+
# discussion in the issue below, as its the simplest to implement and
44+
# allows for selecting files with a pattern.
45+
# https://github.com/actions/upload-release-asset/issues/4
46+
#uses: actions/[email protected]
47+
uses: csexton/release-asset-action@master
48+
with:
49+
pattern: "bundles/*"
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
51+
52+
upload-pypi:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v1
56+
- name: Set up Python
57+
uses: actions/setup-python@v1
58+
with:
59+
python-version: '3.x'
60+
- name: Install dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install setuptools wheel twine
64+
- name: Build and publish
65+
env:
66+
TWINE_USERNAME: ${{ secrets.pypi_username }}
67+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
68+
run: |
69+
python setup.py sdist
70+
twine upload dist/*

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ __pycache__
44
_build
55
*.pyc
66
.env
7-
build*
87
bundles
98
*.DS_Store
109
.eggs

.travis.yml

-32
This file was deleted.

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Introduction
99
:target: https://adafru.it/discord
1010
:alt: Discord
1111
12-
.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_ADS1x15.svg?branch=master
13-
:target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_ADS1x15
12+
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15/workflows/Build%20CI/badge.svg
13+
:target: https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15/actions/
1414
:alt: Build Status
1515

1616
Support for the ADS1x15 series of analog-to-digital converters. Available in 12-bit (ADS1015)

0 commit comments

Comments
 (0)