Skip to content

Commit

Permalink
CI/Packaging: Sync with boilerplate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Jul 4, 2024
1 parent 3bc2987 commit 63ecf1d
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ on:

jobs:
test:
name: Python ${{ matrix.python }}
name: Build (Python ${{ matrix.python }})
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Install Test

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Install (Python ${{ matrix.python }})
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
matrix:
python: ['3.9', '3.10', '3.11']

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Stub files & Patch install.sh
run: |
mkdir -p boot/firmware
touch boot/firmware/config.txt
sed -i "s|/boot/firmware|`pwd`/boot/firmware|g" install.sh
sed -i "s|sudo raspi-config|raspi-config|g" pyproject.toml
touch raspi-config
chmod +x raspi-config
echo `pwd` >> $GITHUB_PATH
- name: Run install.sh
run: |
./install.sh --unstable --force
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
test:
name: linting & spelling
name: Linting & Spelling
runs-on: ubuntu-latest
env:
TERM: xterm-256color
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ on:

jobs:
test:
name: Python ${{ matrix.python }}
name: Test (Python ${{ matrix.python }})
runs-on: ubuntu-latest
env:
TERM: xterm-256color
strategy:
matrix:
python: ['3.9', '3.10', '3.11']

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ endif
@echo "deploy: build and upload to PyPi"
@echo "tag: tag the repository with the current version\n"

version:
@hatch version

install:
./install.sh --unstable

Expand All @@ -47,7 +50,7 @@ pytest:
nopost:
@bash check.sh --nopost

tag:
tag: version
git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}"

build: check
Expand Down
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ function apt_pkg_install {
sudo apt update
APT_HAS_UPDATED=true
fi
sudo apt install -y "$PACKAGES"
# shellcheck disable=SC2086
sudo apt install -y $PACKAGES
check_for_error
if [ -f "$UNINSTALLER" ]; then
echo "apt uninstall -y $PACKAGES" >> "$UNINSTALLER"
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ isort
twine
hatch
hatch-fancy-pypi-readme
hatch-requirements-txt
tox
pdoc
11 changes: 2 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ commands =
python -m build --no-isolation
python -m twine check dist/*
isort --check .
ruff .
ruff check .
codespell .
deps =
check-manifest
ruff
codespell
isort
twine
build
hatch
hatch-fancy-pypi-readme
-r{toxinidir}/requirements-dev.txt

0 comments on commit 63ecf1d

Please sign in to comment.