|
| 1 | +--- |
| 2 | +name: dist |
| 3 | + |
| 4 | +on: [push, pull_request] |
| 5 | + |
| 6 | +jobs: |
| 7 | + check: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + - uses: psf/black@stable |
| 12 | + |
| 13 | + check-doc: |
| 14 | + runs-on: ubuntu-18.04 |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + with: |
| 19 | + submodules: recursive |
| 20 | + fetch-depth: 0 |
| 21 | + |
| 22 | + - uses: actions/setup-python@v2 |
| 23 | + with: |
| 24 | + python-version: 3.8 |
| 25 | + - name: Sphinx |
| 26 | + run: | |
| 27 | + pip --disable-pip-version-check install -e . |
| 28 | + pip --disable-pip-version-check install -r docs/requirements.txt |
| 29 | + cd docs && make clean html SPHINXOPTS="-W --keep-going" |
| 30 | + |
| 31 | + test: |
| 32 | + runs-on: ${{ matrix.os }} |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + os: [windows-latest, macos-latest, ubuntu-18.04] |
| 36 | + python_version: [2.7, 3.5, 3.6, 3.7, 3.8] |
| 37 | + architecture: [x86, x64] |
| 38 | + exclude: |
| 39 | + - os: macos-latest |
| 40 | + architecture: x86 |
| 41 | + - os: ubuntu-18.04 |
| 42 | + architecture: x86 |
| 43 | + |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + with: |
| 47 | + submodules: recursive |
| 48 | + fetch-depth: 0 |
| 49 | + |
| 50 | + - uses: actions/setup-python@v2 |
| 51 | + with: |
| 52 | + python-version: ${{ matrix.python_version }} |
| 53 | + architecture: ${{ matrix.architecture }} |
| 54 | + |
| 55 | + - name: Install build dependencies |
| 56 | + run: python -m pip --disable-pip-version-check install wheel |
| 57 | + |
| 58 | + - name: Build wheel |
| 59 | + run: python setup.py bdist_wheel |
| 60 | + |
| 61 | + - name: Test wheel |
| 62 | + shell: bash |
| 63 | + run: | |
| 64 | + cd dist |
| 65 | + python -m pip --disable-pip-version-check install *.whl |
| 66 | + cd ../test |
| 67 | + python test_CppHeaderParser.py |
| 68 | +
|
| 69 | + publish: |
| 70 | + runs-on: ubuntu-latest |
| 71 | + needs: [check, check-doc, test] |
| 72 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
| 73 | + |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v2 |
| 76 | + with: |
| 77 | + submodules: recursive |
| 78 | + fetch-depth: 0 |
| 79 | + |
| 80 | + - uses: actions/setup-python@v2 |
| 81 | + with: |
| 82 | + python-version: 3.8 |
| 83 | + - run: pip --disable-pip-version-check install wheel |
| 84 | + |
| 85 | + - name: Build packages |
| 86 | + run: python setup.py sdist bdist_wheel |
| 87 | + - name: Publish to PyPI |
| 88 | + uses: pypa/gh-action-pypi-publish@master |
| 89 | + with: |
| 90 | + user: __token__ |
| 91 | + password: ${{ secrets.PYPI_PASSWORD }} |
0 commit comments