diff --git a/.github/workflows/python-build.yaml b/.github/workflows/python-build.yaml new file mode 100644 index 0000000..6a85727 --- /dev/null +++ b/.github/workflows/python-build.yaml @@ -0,0 +1,45 @@ +name: Python Build Pipeline + +on: + push: + branches: + - master + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10'] + + steps: + - name: Checkout code + 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 -U "flake8==5.0.4" "mypy==0.982" "numpy>=1.21.1" "scipy>=1.7.3" "mpmath==1.3.0" "pytest==7.2.0" "pytest-cov==4.0.0" "attrs==22.1.0" "hypothesis==6.58.0" "coveralls==3.3.1" "sphinx_rtd_theme==1.2.2" "sphinx<7.0.0" + pip install . + + - name: Lint with flake8 + run: flake8 petbox/dca + + - name: Type-check with mypy + run: mypy petbox/dca + + - name: Run tests with pytest + run: pytest --cov=petbox + + - name: Build documentation with Sphinx + run: sphinx-build -W -b html docs docs/_build/html + + - name: Upload coverage to Coveralls + if: success() + run: coveralls