diff --git a/.github/workflows/sphinx-ext-pr.yml b/.github/workflows/sphinx-ext-pr.yml index 73a5319a..efd96812 100644 --- a/.github/workflows/sphinx-ext-pr.yml +++ b/.github/workflows/sphinx-ext-pr.yml @@ -1,4 +1,4 @@ -name: Sphinx Extensions PR +name: 'PR: esbonio-extensions' on: pull_request: branches: @@ -8,7 +8,43 @@ on: - 'lib/esbonio-extensions/**' jobs: - sphinx-exts: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-ext-pr-pip-deps-3.11 + + - run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade tox hatch towncrier + name: Setup Environment + + - run: | + set -e + ./scripts/make_release.py extensions + name: Set Version + + - name: Prepare Package Resources + run: | + cd lib/esbonio-extensions + python -m tox run -e pkg + + - uses: hynek/build-and-inspect-python-package@v1 + with: + path: lib/esbonio-extensions + + test: name: "Python v${{ matrix.python-version }}" runs-on: ubuntu-latest strategy: @@ -22,36 +58,19 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-ext-pr-pip-deps-${{ matrix.python-version }} + - run: | python --version python -m pip install --upgrade pip - python -m pip install --upgrade tox bump2version + python -m pip install --upgrade tox name: Setup Environment - - run: | - set -e - - # Despite the script's name, this is only used to obtain a - # dev version number e.g. v1.2.3-dev4 - ./scripts/make-release.sh extensions - name: Set Version - id: info - if: matrix.python-version == '3.10' - - run: | cd lib/esbonio-extensions python -m tox -e py`echo ${{ matrix.python-version }} | tr -d .` name: Test - - - name: Package - run: | - cd lib/esbonio-extensions - python -m tox -e pkg - if: matrix.python-version == '3.10' - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: 'dist' - path: lib/esbonio-extensions/dist - if: matrix.python-version == '3.10' diff --git a/.github/workflows/sphinx-ext-release.yml b/.github/workflows/sphinx-ext-release.yml index d8e83f04..313bbbaa 100644 --- a/.github/workflows/sphinx-ext-release.yml +++ b/.github/workflows/sphinx-ext-release.yml @@ -22,23 +22,18 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - run: | - sudo apt update - sudo apt install pandoc - python --version python -m pip install --upgrade pip - python -m pip install --upgrade tox bump2version towncrier docutils + python -m pip install --upgrade tox hatch towncrier docutils name: Setup Environment - run: | set -e - - ./scripts/make-release.sh extensions + ./scripts/make_release.py extensions name: Set Version - id: info - name: Package run: | diff --git a/lib/esbonio-extensions/tox.ini b/lib/esbonio-extensions/tox.ini index 8005e6a4..b8d91c6b 100644 --- a/lib/esbonio-extensions/tox.ini +++ b/lib/esbonio-extensions/tox.ini @@ -13,16 +13,16 @@ commands = pytest --cov=esbonio [testenv:pkg] +description = Prepare the resources to be shipped with the package deps = build ../esbonio sphinx-design -usedevelop = True +usedevelop = true allowlist_externals = cp mkdir commands = - sphinx-build -b tutorial ../../docs/ ../../docs/_build/tutorial mkdir esbonio/tutorial_demo cp -r ../../docs/_build/tutorial/extensions esbonio/tutorial_demo/extensions