fixup! fixup! fixup! fixup! python: switch to pdm #221
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: python testsuite and deploy | |
on: [push, pull_request] | |
jobs: | |
run_testsuite: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pdm install -G test -G ci_test | |
- name: Run test suite | |
run: | |
SMTBMC=yowasp-yosys-smtbmc SBY=yowasp-sby YOSYS=yowasp-yosys pdm test | |
publish_pypi: | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- run_testsuite | |
- publish_docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: '3.10' | |
- name: Install deps | |
run: | | |
pdm install -G publish | |
- name: Build package | |
env: | |
DOC_SHA: ${{ needs.publish_docs.outputs.doc_sha }} | |
run: | | |
pdm build | |
- name: Upload to pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
TWINE_NON_INTERACTIVE: 1 | |
run: | | |
twine upload dist/naps* | |
- name: upload | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sdist | |
path: dist/* | |
publish_docs: | |
if: github.ref == 'refs/heads/main' | |
needs: run_testsuite | |
runs-on: ubuntu-latest | |
outputs: | |
doc_sha: ${{ steps.pages.outputs.dst_sha }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: '3.10' | |
- name: Install deps | |
run: | | |
pdm install -G doc | |
- name: Run sphinx autodoc | |
run: | | |
pdm run sphinx-apidoc -o doc naps | |
- name: Build docs | |
run: | | |
make -C doc html | |
- name: Deploy | |
id: pages | |
uses: peaceiris/actions-gh-pages@7e55c73ee896b01b8b8668370794b96f1bc9c759 #514 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./doc/_build/html | |
allow_empty_commit: true | |
- name: Update docs server | |
run: | | |
curl ${{ secrets.DOCS_UPDATE_HOOK }} |