|
| 1 | +name: CI |
| 2 | +"on": |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + schedule: |
| 10 | + - cron: "0 0 * * *" |
| 11 | +concurrency: |
| 12 | + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' |
| 13 | + cancel-in-progress: true |
| 14 | +jobs: |
| 15 | + lint: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + python-version: ["3.12"] |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - uses: eifinger/setup-rye@v4 |
| 23 | + id: setup-rye |
| 24 | + with: |
| 25 | + enable-cache: true |
| 26 | + cache-prefix: ${{ matrix.python-version }} |
| 27 | + - name: Pin python-version ${{ matrix.python-version }} |
| 28 | + if: steps.setup-rye.outputs.cache-hit != 'true' |
| 29 | + run: rye pin ${{ matrix.python-version }} |
| 30 | + - name: Format check |
| 31 | + run: rye fmt --check |
| 32 | + - name: Lint check |
| 33 | + run: rye lint |
| 34 | + test: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + python-version: ["3.10", "3.11", "3.12"] |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + - uses: eifinger/setup-rye@v4 |
| 42 | + id: setup-rye |
| 43 | + with: |
| 44 | + enable-cache: true |
| 45 | + cache-prefix: ${{ matrix.python-version }} |
| 46 | + - name: Pin python-version ${{ matrix.python-version }} |
| 47 | + if: steps.setup-rye.outputs.cache-hit != 'true' |
| 48 | + run: rye pin ${{ matrix.python-version }} |
| 49 | + - name: Install dependencies |
| 50 | + if: steps.setup-rye.outputs.cache-hit != 'true' |
| 51 | + run: | |
| 52 | + rye sync --no-lock |
| 53 | + - name: Test |
| 54 | + run: rye test -- --cov-report term-missing |
| 55 | + build: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + strategy: |
| 58 | + matrix: |
| 59 | + python-version: ["3.12"] |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + with: |
| 63 | + fetch-depth: 10 |
| 64 | + fetch-tags: true |
| 65 | + - uses: eifinger/setup-rye@v4 |
| 66 | + id: setup-rye |
| 67 | + with: |
| 68 | + enable-cache: true |
| 69 | + cache-prefix: ${{ matrix.python-version }} |
| 70 | + - name: Pin python-version ${{ matrix.python-version }} |
| 71 | + if: steps.setup-rye.outputs.cache-hit != 'true' |
| 72 | + run: rye pin ${{ matrix.python-version }} |
| 73 | + - name: Build |
| 74 | + run: rye build --clean |
| 75 | + - uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: dist_${{ github.ref }} |
| 78 | + path: dist |
0 commit comments