python-package.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
  2. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
  3. name: Python package
  4. on:
  5. push:
  6. branches: [ "master" ]
  7. pull_request:
  8. branches: [ "master" ]
  9. workflow_dispatch:
  10. jobs:
  11. build:
  12. runs-on: ubuntu-latest
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. python-version: ["3.9", "3.10", "3.11"]
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Set up Python ${{ matrix.python-version }}
  20. uses: actions/setup-python@v5
  21. with:
  22. python-version: ${{ matrix.python-version }}
  23. - name: Install dependencies
  24. run: |
  25. python -m pip install --upgrade pip
  26. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  27. - name: Install wheel
  28. run: |
  29. python -m pip install wheel
  30. - name: Build wheel
  31. run: |
  32. python setup.py bdist_wheel
  33. - name: Upload artifact
  34. uses: actions/upload-artifact@v4
  35. with:
  36. name: wheel-file
  37. path: dist/*.whl
  38. retention-days: 30