File: ci.yml

package info (click to toggle)
python-sentinels 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 124 kB
  • sloc: python: 45; sh: 7; makefile: 3
file content (61 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:
    # manually triggered

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v5
      - name: Install the default version of uv
        id: setup-uv
        uses: astral-sh/setup-uv@v3
      - name: Print the installed version
        run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
      - name: Install Python ${{ matrix.python-version }}
        run: uv python install  ${{ matrix.python-version }}
      - name: Tests
        run: |
          uv venv
          uv pip install ".[testing]"
          .venv/bin/pytest tests
          .venv/bin/pylint --rcfile=.pylintrc sentinels tests

  publish:
    if: startsWith(github.ref, 'refs/tags/')
    needs: test
    runs-on: ubuntu-latest
    environment: release
    permissions:
      id-token: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install hatch
        run: pip install hatch

      - name: Build package
        run: hatch build

      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          attestations: true
          skip-existing: true