diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07620e3..99fdeab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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'] diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml new file mode 100644 index 0000000..f3c1a2d --- /dev/null +++ b/.github/workflows/install.yml @@ -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 diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index ac672a5..2e166c0 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -8,7 +8,7 @@ on: jobs: test: - name: linting & spelling + name: Linting & Spelling runs-on: ubuntu-latest env: TERM: xterm-256color diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f8cff7..9e29cb9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/Makefile b/Makefile index 34f4a7d..56cf0df 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/install.sh b/install.sh index 8405182..37a49f2 100755 --- a/install.sh +++ b/install.sh @@ -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" diff --git a/requirements-dev.txt b/requirements-dev.txt index 525b042..d392e8f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,5 +5,6 @@ isort twine hatch hatch-fancy-pypi-readme +hatch-requirements-txt tox pdoc diff --git a/tox.ini b/tox.ini index 44c8654..2b6d87b 100644 --- a/tox.ini +++ b/tox.ini @@ -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