-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JPOSADA202020
committed
Jan 5, 2025
1 parent
e39e092
commit 71b5731
Showing
48 changed files
with
258 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,113 @@ | ||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries | ||
# SPDX-FileCopyrightText: 2023 Jose D. Montoya | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# SPDX-License-Identifier: Unlicense | ||
|
||
name: Build CI | ||
|
||
on: [pull_request, push] | ||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
push: | ||
|
||
jobs: | ||
test: | ||
build-wheel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run Build CI workflow | ||
uses: jposada202020/workflows-circuitpython-libs/build@main | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Build wheel | ||
run: pip wheel -w dist --no-deps . | ||
|
||
- name: check dist | ||
run: pipx run twine check dist/* | ||
|
||
- name: Archive wheel | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheel | ||
path: ${{ github.workspace }}/dist/ | ||
|
||
linters: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Install pre-commit and deps | ||
run: pip install pre-commit -r requirements.txt | ||
|
||
- name: Setup problem matchers | ||
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 | ||
|
||
- name: Pre-commit hooks | ||
run: pre-commit run --all-files | ||
|
||
build-bundles: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Translate Repo Name For Build Tools filename_prefix | ||
id: repo-name | ||
run: | | ||
echo repo-name=$( | ||
echo ${{ github.repository }} | | ||
awk -F '\/' '{ print tolower($2) }' | | ||
tr '_' '-' | ||
) >> $GITHUB_OUTPUT | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Checkout tools repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: adafruit/actions-ci-circuitpython-libs | ||
path: actions-ci | ||
|
||
- name: Install deps | ||
run: | | ||
source actions-ci/install.sh | ||
- name: Build assets | ||
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . | ||
|
||
- name: Archive bundles | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bundles | ||
path: ${{ github.workspace }}/bundles/ | ||
|
||
build-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install deps | ||
run: | | ||
pip install -r docs/requirements.txt -r requirements.txt | ||
- name: Build docs | ||
working-directory: docs | ||
run: sphinx-build -E -W -b html . _build/html | ||
|
||
- name: Archive docs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: docs | ||
path: ${{ github.workspace }}/docs/_build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,41 @@ | ||
# SPDX-FileCopyrightText: 2023 Jose D. Montoya | ||
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò | ||
# | ||
# SPDX-License-Identifier: Unlicense | ||
|
||
repos: | ||
- repo: https://github.com/python/black | ||
rev: 23.3.0 | ||
rev: 24.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
args: | ||
- --fix=lf | ||
- repo: https://github.com/pycqa/pylint | ||
rev: v2.17.4 | ||
rev: v3.3.1 | ||
hooks: | ||
- id: pylint | ||
name: pylint (library code) | ||
types: [python] | ||
args: | ||
- --disable=consider-using-f-string | ||
exclude: "^(docs/|examples/|tests/)" | ||
exclude: "^(docs/|examples/|tests/|setup.py$)" | ||
- id: pylint | ||
name: pylint (example code) | ||
description: Run pylint rules on "examples/*.py" files | ||
types: [python] | ||
files: "^examples/" | ||
args: | ||
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code | ||
- id: pylint | ||
name: pylint (test code) | ||
description: Run pylint rules on "tests/*.py" files | ||
types: [python] | ||
files: "^tests/" | ||
args: | ||
- --disable=missing-docstring,consider-using-f-string,duplicate-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ | |
) | ||
|
||
# Showing the plot | ||
display.show(plot) | ||
display.root_group = plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
Bar(plot, a, b, 0xFF1000, True) | ||
|
||
# Plotting and showing the plot | ||
display.show(plot) | ||
display.root_group = plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ | |
group.append(plot_scale1) | ||
group.append(plot_scale2) | ||
|
||
display.show(group) | ||
display.root_group = group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,4 +119,4 @@ def heat_index(temp, humidity): | |
color.BLUE, | ||
) | ||
g.append(my_table) | ||
display.show(g) | ||
display.root_group = g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ | |
g.append(text_area) | ||
g.append(text2_area) | ||
|
||
display.show(g) | ||
display.root_group = g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ | |
plot.append(roundrect) | ||
|
||
# Plotting and showing the plot | ||
display.show(plot) | ||
display.root_group = plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ | |
|
||
Fillbetween(plot, x, y1, y2) | ||
|
||
display.show(plot) | ||
display.root_group = plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ | |
plot.draw_circle(radius=8, x=120, y=120) | ||
|
||
# Showing in the screen | ||
display.show(plot) | ||
display.root_group = plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.