|
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 | | - |
4 | | -name: Python package |
| 1 | +name: Build Python Package |
5 | 2 |
|
6 | 3 | on: |
7 | 4 | push: |
8 | 5 | branches: [ "master" ] |
9 | 6 | pull_request: |
10 | 7 | branches: [ "master" ] |
11 | 8 |
|
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
12 | 12 | jobs: |
13 | 13 | build: |
14 | | - |
15 | 14 | runs-on: ubuntu-latest |
16 | 15 | strategy: |
17 | 16 | fail-fast: false |
18 | 17 | matrix: |
19 | | - os: [ubuntu-latest, macos-latest, windows-latest] |
20 | | - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] |
| 18 | + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
21 | 19 |
|
22 | 20 | steps: |
23 | | - - uses: actions/checkout@v4 |
24 | | - - name: Setup Python # Set Python version |
25 | | - uses: actions/setup-python@v4 |
| 21 | + - uses: actions/checkout@v7 |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v7 |
26 | 24 | with: |
27 | 25 | python-version: ${{ matrix.python-version }} |
28 | | - cache: 'pip' |
29 | | - # Install pip and pytest |
30 | | - - name: Install dependencies |
31 | | - run: | |
32 | | - python -m pip install --upgrade pip |
33 | | - pip install pytest |
34 | | - - name: Test with pytest |
35 | | - run: pytest tests.py --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml |
36 | | - - name: Upload pytest test results |
37 | | - uses: actions/upload-artifact@v3 |
38 | | - with: |
39 | | - name: pytest-results-${{ matrix.python-version }} |
40 | | - path: junit/test-results-${{ matrix.python-version }}.xml |
41 | | - # Use always() to always run this step to publish test results when there are test failures |
42 | | - if: ${{ always() }} |
| 26 | + - name: Install build frontend |
| 27 | + run: python -m pip install --upgrade pip build |
| 28 | + - name: Build distributions |
| 29 | + run: python -m build |
0 commit comments