Skip to content

Commit

Permalink
Correct GitHub actions and Release script (#319)
Browse files Browse the repository at this point in the history
* Ensure Linter Black runs as test
* Update Release script
* Correct Workflow names
  • Loading branch information
JoseIgnacioTamayo committed Oct 12, 2023
1 parent 1b7ee10 commit 1c28486
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python test
name: Run TOX tests

on:
push:
Expand All @@ -10,6 +10,16 @@ on:
branches: [ "master" ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Install testing dependency
run: pip install tox
- name: Lint with black
run: tox -e black
test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -23,14 +33,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install building and testing dependencies
run: pip install tox black build
- name: Run tox
- name: Install testing dependencies
run: pip install tox
- name: Run tox for ${{ matrix.python-version }}
# Run tox using the version of Python in `PATH`
run: tox -e py
- name: Build package
run: python -m build
run: tox -e py
16 changes: 11 additions & 5 deletions scripts/release.sh
@@ -1,16 +1,22 @@
#!/bin/bash

THISDIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BASEDIR=$THISDIR/..
rm $BASEDIR/dist/*.whl $BASEDIR/dist/*.tar.gz

rm $THISDIR/../dist/*.whl $THISDIR/../dist/*.tar.gz
virtualenv $BASEDIR/pyvirtualenv
source $BASEDIR/pyvirtualenv/bin/activate

python $THISDIR/../setup.py bdist_wheel sdist

coverage run setup.py test -q
pip install -r $BASEDIR/requirements.txt
pip install tox

python -m tox --root $BASEDIR/
if [ $? -ne 0 ]; then
echo "FAILED: Cannot release a broken version!"
exit 127
fi

twine upload -s $THISDIR/../dist/pyangbind*
pip install twine build
python -m build --outdir $BASEDIR/dist/

python -m twine upload -s $BASEDIR/dist/pyangbind*

0 comments on commit 1c28486

Please sign in to comment.