Pyzotero: a Python client for the Zotero API pyzotero.readthedocs.io
zotero

Merge pull request #233 from urschrei/shugel/push-ovoqrlxummwu

Improve GitHub Actions workflow: add caching, concurrency control, be…

authored by urschrei.eurosky.social and committed by

GitHub e90c86f7 9970ce54

+20 -3
+20 -3
.github/workflows/tests.yml
··· 1 - name: Build wheel, release and publish on new tag 1 + name: CI/CD 2 2 3 3 on: 4 4 push: 5 5 pull_request: 6 6 merge_group: 7 + 8 + concurrency: 9 + group: ${{ github.workflow }}-${{ github.ref }} 10 + cancel-in-progress: true 7 11 8 12 jobs: 9 13 lint: ··· 23 27 name: Build and test 24 28 runs-on: ubuntu-latest 25 29 strategy: 30 + fail-fast: false 26 31 matrix: 27 32 python-version: [3.9, 3.10.9, 3.11, 3.12, 3.13] 28 33 ··· 34 39 uses: astral-sh/setup-uv@v6 35 40 with: 36 41 python-version: ${{ matrix.python-version }} 42 + enable-cache: true 43 + cache-dependency-glob: "**/pyproject.toml" 37 44 38 45 - name: Install the project and deps 39 46 run: uv sync --dev 40 47 41 48 - name: Run tests 42 - run: uv run pytest 49 + run: uv run pytest --junit-xml=junit.xml 43 50 44 51 - name: Build wheel 45 52 run: uv build --no-sources --wheel -o dist ··· 47 54 - uses: actions/upload-artifact@v4 48 55 name: Upload wheel as artifact 49 56 with: 50 - name: wheels-${{ strategy.job-index }} 57 + name: wheels-py${{ matrix.python-version }} 51 58 path: | 52 59 ./dist/*.whl 53 60 61 + - uses: actions/upload-artifact@v4 62 + name: Upload test results 63 + if: always() 64 + with: 65 + name: test-results-py${{ matrix.python-version }} 66 + path: junit.xml 67 + 54 68 make_sdist: 55 69 name: Make SDist 56 70 runs-on: ubuntu-latest ··· 62 76 63 77 - name: Install uv 64 78 uses: astral-sh/setup-uv@v6 79 + with: 80 + enable-cache: true 65 81 66 82 - name: Build SDist 67 83 run: uv build --no-sources --sdist -o dist 68 84 69 85 - uses: actions/upload-artifact@v4 70 86 with: 87 + name: sdist 71 88 path: dist/*.tar.gz 72 89 73 90 status_check: