File: cd.yml

package info (click to toggle)
python-apischema 0.18.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,636 kB
  • sloc: python: 15,281; makefile: 3; sh: 2
file content (69 lines) | stat: -rw-r--r-- 2,043 bytes parent folder | download | duplicates (2)
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
62
63
64
65
66
67
68
69
name: CD

on:
  workflow_dispatch:
  release:
    types: [published]

jobs:
  build_sdist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: scripts/cythonize.sh
      - run: pipx run build --sdist
      - uses: actions/upload-artifact@v4
        with:
          name: dist-sdist
          path: dist/*.tar.gz
  build_pure_wheel:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - run: scripts/cythonize.sh
    - run: NO_EXTENSION=1 pipx run build
    - uses: actions/upload-artifact@v4
      with:
        name: dist-wheel
        path: dist/*.whl
  build_wheels:
    name: Wheel on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python 3.12 (MacOS)
        if: matrix.os == 'macos-latest'
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: scripts/cythonize.sh
      - run: scripts/generate_tests_from_examples.py
      - uses: pypa/cibuildwheel@v2.21.1
        env:
          CIBW_SKIP: pp*
          CIBW_TEST_COMMAND: pytest {project}/tests
          # TODO execute tests on Windows (https://github.com/wyfo/apischema/runs/4622330189)
          CIBW_TEST_COMMAND_WINDOWS: python -c "import apischema"
          CIBW_BEFORE_TEST: pip install -r tests/requirements.txt
          # TODO is skipping still necessary?
          CIBW_TEST_SKIP: "*universal2:arm64"
      - uses: actions/upload-artifact@v4
        with:
          name: dist-${{ matrix.os }}
          path: wheelhouse/*.whl
  publish:
    needs: [build_sdist, build_wheels]
    runs-on: ubuntu-latest
    if: github.event_name == 'release' && github.event.action == 'published'
    steps:
    - uses: actions/download-artifact@v4
      with:
        path: dist
        pattern: dist-*
        merge-multiple: true
    - uses: pypa/gh-action-pypi-publish@v1.8.10
      with:
        password: ${{ secrets.PYPI_TOKEN }}