Skip to content

Commit a4e7f56

Browse files
committed
fix: dev: add pyusb requires, bump python and github action versions
* cleanup and update most tox commands, add descriptions * try getting basic shell cmds working on windoze Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
1 parent 142c36f commit a4e7f56

7 files changed

Lines changed: 137 additions & 179 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
build:
10+
matrix_build:
1111

1212
runs-on: ${{ matrix.os }}
13+
permissions:
14+
contents: read
1315
defaults:
1416
run:
1517
shell: bash
@@ -21,20 +23,20 @@ jobs:
2123
strategy:
2224
fail-fast: false
2325
matrix:
24-
os: [ubuntu-20.04, macos-latest]
25-
python-version: [3.7, 3.8, 3.9, '3.10']
26+
os: [ubuntu-24.04, macos-latest, windows-latest]
27+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
2628
steps:
2729
- name: Set git crlf/eol
2830
run: |
2931
git config --global core.autocrlf false
3032
git config --global core.eol lf
3133
32-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v5
3335
with:
34-
submodules: True
36+
fetch-depth: 0
3537

3638
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v2
39+
uses: actions/setup-python@v5
3840
with:
3941
python-version: ${{ matrix.python-version }}
4042

@@ -43,32 +45,8 @@ jobs:
4345
python -m pip install --upgrade pip
4446
pip install tox tox-gh-actions
4547
46-
- name: Install deps with apt helper action
47-
uses: ryankurte/action-apt@v0.2.0
48-
if: runner.os == 'Linux'
49-
with:
50-
# architectures to pass to dpkg --add-architecture
51-
#architectures: # optional
52-
packages: libusb-dev libusb-1.0.0-dev
53-
5448
- name: Run tests
5549
run: |
5650
tox
5751
env:
5852
PLATFORM: ${{ matrix.os }}
59-
60-
- name: Check pkg builds
61-
run: |
62-
tox -e deploy
63-
64-
- name: Check wheel
65-
run: |
66-
tox -e check
67-
68-
- name: Build C tool
69-
if: runner.os == 'Linux'
70-
run: |
71-
tox -e badge
72-
env:
73-
CC: 'gcc'
74-
CXX: 'g++'

‎.github/workflows/pylint.yml‎

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
jobs:
1010
pylint:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-24.04
13+
permissions:
14+
contents: read
1315
defaults:
1416
run:
1517
shell: bash
@@ -19,7 +21,9 @@ jobs:
1921
path: ${{ steps.analyze.outputs.path }}
2022

2123
steps:
22-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v5
25+
with:
26+
fetch-depth: 0
2327

2428
- name: Extract base branch name
2529
id: extract_branch
@@ -34,17 +38,21 @@ jobs:
3438
else
3539
EXPORT_VALUE="${TMP_GITHUB_REF}"
3640
fi
37-
echo "##[set-output name=branch;]${EXPORT_VALUE}"
41+
echo "branch=${EXPORT_VALUE}" >> $GITHUB_OUTPUT
3842
39-
- name: Set up Python 3.8
40-
uses: actions/setup-python@v4
43+
- name: Set up Python 3.10
44+
uses: actions/setup-python@v5
4145
with:
42-
python-version: 3.8
46+
python-version: '3.10'
4347

4448
- name: Install tox
4549
run: |
46-
python -m pip install --upgrade pip wheel
47-
pip install tox tox-gh-actions
50+
python -m pip install --upgrade pip
51+
pip install tox
52+
53+
#- name: Run tox bare-ass
54+
#run: |
55+
#tox -e lint
4856

4957
- name: Run pylint
5058
id: analyze
@@ -53,36 +61,37 @@ jobs:
5361
run: |
5462
rating=$(bash -c 'tox -e lint' | grep 'Your code has been rated at' | cut -f7 -d " ")
5563
echo "Pylint score: ${rating}"
56-
echo "##[set-output name=rating;]${rating}"
57-
echo "##[set-output name=path;]${BADGE_PATH}"
64+
echo "rating=${rating}" >> $GITHUB_OUTPUT
65+
echo "path=${BADGE_PATH}" >> $GITHUB_OUTPUT
5866
5967
badge:
6068
# Only generate and publish if these conditions are met:
6169
# - The previous job/analyze step ended successfully
6270
# - At least one of these is true:
63-
# - This is a push event and the push event is on branch 'master' or 'develop'
71+
# - This is a push event and the push event is on branch 'main' or 'develop'
6472
# Note: if this repo is personal (ie, not an org repo) then you can
6573
# use the following to change the scope of the next 2 jobs
6674
# instead of running on branch push as shown below:
6775
# - This is a pull request event and the pull actor is the same as the repo owner
68-
# if: ${{ ( github.event_name == 'pull_request' && github.actor == github.repository_owner ) || github.ref == 'refs/heads/master' }}
76+
# if: ${{ ( github.event_name == 'pull_request' && github.actor == github.repository_owner ) || github.ref == 'refs/heads/main' }}
6977
name: Generate badge image with pylint score
70-
runs-on: ubuntu-20.04
78+
runs-on: ubuntu-24.04
79+
permissions:
80+
pull-requests: read
81+
contents: write
82+
actions: read
7183
needs: [pylint]
7284
if: ${{ github.event_name == 'push' }}
73-
#outputs:
74-
#url: ${{ steps.url.outputs.url }}
75-
#markdown: ${{ steps.url.outputs.markdown }}
7685

7786
steps:
78-
- uses: actions/checkout@v3
87+
- uses: actions/checkout@v5
7988
with:
8089
ref: badges
8190
path: badges
8291

8392
# Use the output from the `analyze` step
8493
- name: Create pylint badge
85-
uses: emibcn/badge-action@v1.2.4
94+
uses: emibcn/badge-action@808173dd03e2f30c980d03ee49e181626088eee8 # v2.0.3
8695
id: badge
8796
with:
8897
label: 'Pylint score'
@@ -96,16 +105,16 @@ jobs:
96105
FILE: 'pylint-score.svg'
97106
working-directory: ./badges
98107
run: |
99-
git config --local user.email "action@github.com"
100-
git config --local user.name "GitHub Action"
108+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
109+
git config --local user.name "github-actions[bot]"
101110
mkdir -p "${BRANCH}"
102111
mv "${FILE}" "${BRANCH}"
103112
git add "${BRANCH}/${FILE}"
104113
# Will give error if badge has not changed
105114
git commit -m "Add/Update badge" || true
106115
107116
- name: Push badge commit
108-
uses: ad-m/github-push-action@master
117+
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0
109118
with:
110119
github_token: ${{ secrets.GITHUB_TOKEN }}
111120
branch: badges

‎.github/workflows/release.yml‎

Lines changed: 23 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,26 @@
11
name: Release
22

33
on:
4+
workflow_dispatch:
45
push:
56
# release on tag push
67
tags:
78
- '*'
89

9-
jobs:
10-
wheels:
11-
12-
runs-on: ${{ matrix.os }}
13-
defaults:
14-
run:
15-
shell: bash
16-
env:
17-
PYTHONIOENCODING: utf-8
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
os: [ubuntu-20.04, macos-latest, windows-2019]
22-
python-version: [3.7, 3.8, 3.9, '3.10']
23-
24-
steps:
25-
- name: Set git crlf/eol
26-
run: |
27-
git config --global core.autocrlf false
28-
git config --global core.eol lf
29-
30-
- uses: actions/checkout@v3
31-
with:
32-
fetch-depth: 0
33-
34-
- name: Set up Python ${{ matrix.python-version }}
35-
uses: actions/setup-python@v4
36-
with:
37-
python-version: ${{ matrix.python-version }}
10+
permissions:
11+
contents: write
3812

39-
- name: Install dependencies
40-
run: |
41-
python -m pip install --upgrade pip wheel
42-
pip install tox tox-gh-actions
43-
44-
- name: Build dist pkgs
45-
run: |
46-
tox -e deploy
47-
48-
- name: Upload artifacts
49-
if: matrix.python-version == 3.8 && runner.os != 'Windows'
50-
uses: actions/upload-artifact@v3
51-
with:
52-
name: wheels
53-
path: ./dist/*.whl
13+
jobs:
14+
build_wheels:
15+
name: Build wheels
16+
permissions:
17+
contents: read
18+
uses: ./.github/workflows/wheels.yml
5419

5520
create_release:
5621
name: Create Release
57-
needs: [wheels]
58-
runs-on: ubuntu-20.04
22+
needs: [build_wheels, build_docs]
23+
runs-on: ubuntu-22.04
5924

6025
steps:
6126
- name: Get version
@@ -64,21 +29,26 @@ jobs:
6429
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
6530
echo ${{ env.VERSION }}
6631
67-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v5
6833
with:
6934
fetch-depth: 0
7035

7136
# download all artifacts to project dir
72-
- uses: actions/download-artifact@v3
37+
- uses: actions/download-artifact@v5
38+
39+
- name: check artifacts
40+
run: |
41+
ls -l packages/
7342
7443
- name: Generate changes file
75-
uses: sarnold/gitchangelog-action@master
44+
uses: sarnold/gitchangelog-action@915234f151ceffb7a8c4f76de77e4ae321087b8f # v1.1.1
7645
with:
77-
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
github_token: ${{ secrets.GITHUB_TOKEN}}
7847

7948
- name: Create release
8049
id: create_release
81-
uses: softprops/action-gh-release@v1
50+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
51+
if: startsWith(github.ref, 'refs/tags/')
8252
env:
8353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8454
with:
@@ -88,4 +58,5 @@ jobs:
8858
draft: false
8959
prerelease: false
9060
files: |
91-
wheels/cp210x*.whl
61+
packages/*.whl
62+
packages/*.tar.gz

0 commit comments

Comments
 (0)