Skip to content

Commit 3a2db8f

Browse files
authored
Merge pull request #20 from tekktrik/dev/update-ci
Update CI to use composite actions
2 parents 90ab56c + 01e80e0 commit 3a2db8f

File tree

9 files changed

+529
-419
lines changed

9 files changed

+529
-419
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,5 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Dump GitHub context
14-
env:
15-
GITHUB_CONTEXT: ${{ toJson(github) }}
16-
run: echo "$GITHUB_CONTEXT"
17-
- name: Translate Repo Name For Build Tools filename_prefix
18-
id: repo-name
19-
run: |
20-
echo ::set-output name=repo-name::$(
21-
echo ${{ github.repository }} |
22-
awk -F '\/' '{ print tolower($2) }' |
23-
tr '_' '-'
24-
)
25-
- name: Set up Python 3.x
26-
uses: actions/setup-python@v2
27-
with:
28-
python-version: "3.x"
29-
- name: Versions
30-
run: |
31-
python3 --version
32-
- name: Checkout Current Repo
33-
uses: actions/checkout@v1
34-
with:
35-
submodules: true
36-
- name: Checkout tools repo
37-
uses: actions/checkout@v2
38-
with:
39-
repository: adafruit/actions-ci-circuitpython-libs
40-
path: actions-ci
41-
- name: Install dependencies
42-
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
43-
run: |
44-
source actions-ci/install.sh
45-
- name: Pip install Sphinx, pre-commit
46-
run: |
47-
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
48-
- name: Library version
49-
run: git describe --dirty --always --tags
50-
- name: Setup problem matchers
51-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
52-
- name: Pre-commit hooks
53-
run: |
54-
pre-commit run --all-files
55-
- name: Build assets
56-
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
57-
- name: Archive bundles
58-
uses: actions/upload-artifact@v2
59-
with:
60-
name: bundles
61-
path: ${{ github.workspace }}/bundles/
62-
- name: Build docs
63-
working-directory: docs
64-
run: sphinx-build -E -W -b html . _build/html
65-
- name: Check For pyproject.toml
66-
id: need-pypi
67-
run: |
68-
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
69-
- name: Build Python package
70-
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
71-
run: |
72-
pip install --upgrade build twine
73-
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
74-
sed -i -e "s/0.0.0-auto.0/1.2.3/" $file;
75-
done;
76-
python -m build
77-
twine check dist/*
13+
- name: Run Build CI workflow
14+
uses: adafruit/workflows-circuitpython-libs/build@main

.github/workflows/release.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/release_gh.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: GitHub Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Run GitHub Release CI workflow
16+
uses: adafruit/workflows-circuitpython-libs/release-gh@main
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
upload-url: ${{ github.event.release.upload_url }}

.github/workflows/release_pypi.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: PyPI Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Run PyPI Release CI workflow
16+
uses: adafruit/workflows-circuitpython-libs/release-pypi@main
17+
with:
18+
pypi-username: ${{ secrets.pypi_username }}
19+
pypi-password: ${{ secrets.pypi_password }}

.pre-commit-config.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,40 @@
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6-
- repo: https://github.com/python/black
6+
- repo: https://github.com/python/black
77
rev: 22.3.0
88
hooks:
9-
- id: black
10-
- repo: https://github.com/fsfe/reuse-tool
11-
rev: v0.12.1
9+
- id: black
10+
- repo: https://github.com/fsfe/reuse-tool
11+
rev: v0.14.0
1212
hooks:
13-
- id: reuse
14-
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v2.3.0
13+
- id: reuse
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.2.0
1616
hooks:
17-
- id: check-yaml
18-
- id: end-of-file-fixer
19-
- id: trailing-whitespace
20-
- repo: https://github.com/pycqa/pylint
17+
- id: check-yaml
18+
- id: end-of-file-fixer
19+
- id: trailing-whitespace
20+
- repo: https://github.com/pycqa/pylint
2121
rev: v2.15.5
2222
hooks:
23-
- id: pylint
23+
- id: pylint
2424
name: pylint (library code)
2525
types: [python]
2626
args:
2727
- --disable=consider-using-f-string
2828
exclude: "^(docs/|examples/|tests/|setup.py$)"
29-
- id: pylint
29+
- id: pylint
3030
name: pylint (example code)
3131
description: Run pylint rules on "examples/*.py" files
3232
types: [python]
3333
files: "^examples/"
3434
args:
35-
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
36-
- id: pylint
35+
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
36+
- id: pylint
3737
name: pylint (test code)
3838
description: Run pylint rules on "tests/*.py" files
3939
types: [python]
4040
files: "^tests/"
4141
args:
42-
- --disable=missing-docstring,consider-using-f-string,duplicate-code
42+
- --disable=missing-docstring,consider-using-f-string,duplicate-code

0 commit comments

Comments
 (0)