Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #823 from engnadeau/ci/better-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
engnadeau authored Aug 30, 2022
2 parents 2e4cf7a + 77755cc commit 1fc7277
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 39 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name: Publish
name: Publish to PyPI

on:
release:
types: [created]
types:
- created

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build and publish
run: |
poetry version $(git describe --tags --abbrev=0)
poetry build
poetry publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# use latest stable python version for publishing
python-version: "3.x"
- name: Install dependencies
run: |
pip install poetry
- name: Build and publish
run: |
make build
poetry publish \
--username ${{ secrets.PYPI_USERNAME }} \
--password ${{ secrets.PYPI_PASSWORD }}
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Release
name: GitHub Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v1
with:
Expand Down
117 changes: 100 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,126 @@ name: Test

on:
push:
branches: [master]
branches:
- master
pull_request:
branches: [master]
branches:
- master

jobs:
build:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
# TODO: use linting dev group? #798
# TODO: use ` --dev-only` from next poetry release?
poetry install
- name: Run linting checks
run: |
make lint
test-build-and-installs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
- name: Install dependencies
run: |
sudo apt-get install gcc gfortran libopenblas-dev liblapack-dev cython
python -m pip install --upgrade pip
pip install poetry
- name: Install core dependencies
- name: Run build
run: |
make build
- name: Run installs
run: |
# test local install
pip install --no-deps --force-reinstall .
# test wheel
pip install --no-deps --force-reinstall dist/*.whl
# test tarball
pip install --no-deps --force-reinstall dist/*.tar.gz
test-examples:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
poetry install --no-dev
- name: Test example
run: |
poetry run python examples/basic_usage.py
- name: Install dev dependencies
make test-examples
test-unit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Run linting checks
run: |
make check
- name: Run unit tests
- name: Unit testing
run: |
make test
- name: Run notebook tests
test-notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Test notebooks
run: |
make test-notebooks
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ format:
poetry run black .
poetry run isort .

.PHONY: test-all
test-all: test test-examples test-notebooks

.PHONY: test
test:
PYTHONPATH=. \
Expand All @@ -45,6 +48,8 @@ test-examples: examples/*.py

.PHONY: build
build:
# bump local package version to match git tag and build package
poetry version $(shell git describe --tags --abbrev=0)
poetry build

.PHONY: paper
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pybotics"
version = "0.0.0"
version = "2.0.1"
description = "Python Toolbox for Robotics"
authors = ["Nicholas Nadeau <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 1fc7277

Please sign in to comment.