Update ubuntu.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Packaging (chapter 7) | |
on: | |
- push | |
jobs: | |
test_ubuntu: | |
name: Test_ubuntu | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: | |
- version: "3.10" | |
toxenv: "py310" | |
- version: "3.9" | |
toxenv: "py39" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python "3.10" | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 | |
python -m pip install -r requirements.txt | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
test_macos: | |
name: Test_MacOS | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python: | |
- version: "3.10" | |
toxenv: "py310" | |
- version: "3.9" | |
toxenv: "py39" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python "3.10" | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 | |
python -m pip install -r requirements.txt | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
test_windows: | |
name: Test_Windows | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python: | |
- version: "3.10" | |
toxenv: "py310" | |
- version: "3.9" | |
toxenv: "py39" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python "3.10" | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 | |
python -m pip install -r requirements.txt | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
build_source_dist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install build | |
run: python -m pip install build | |
- name: Run build | |
# run: python -m build --sdist --wheel | |
run: python -m build | |
working-directory: . # You don't need this in your package | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./dist/*.tar.gz | |
build_wheels: | |
name: Build wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install build | |
run: python -m pip install build | |
- name: Run build | |
run: python -m build | |
working-directory: . # You don't need this in your package | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./dist/*.whl | |
# build_wheels: | |
# name: Build wheels on ${{ matrix.os }} | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# matrix: | |
# # os: [ubuntu-20.04, windows-2019, macOS-10.15] | |
# os: [ubuntu-20.04] | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/[email protected] | |
# with: | |
# python-version: "3.10" | |
# - name: Install cibuildwheel | |
# run: python -m pip install cibuildwheel==2.3.1 | |
# - name: Build wheels | |
# run: python -m cibuildwheel --output-dir wheels | |
# working-directory: . # You don't need this in your package | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# path: ./wheels/*.whl # Update to match root of package | |
#publish: | |
# name: Publish package | |
# if: startsWith(github.event.ref, 'refs/tags/v') | |
# needs: | |
# - test_windows | |
# - test_ubuntu | |
# - test_macos | |
# - build_source_dist | |
# - build_wheels | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: artifact | |
# path: ./dist # Update to match root of package | |
# - uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_API_TOKEN }} | |
# packages_dir: ./dist/ # You don't need this in your package |