From 10418d74fe2dcc078537dd4c9ca6d02a7960e58e Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 15:14:18 +0100 Subject: [PATCH 1/7] add inline action to install Pydoc-Markdown in CI --- .github/actions/install/action.yml | 15 +++++++++++++++ .github/workflows/examples.yaml | 14 ++++++++++++++ .github/workflows/python.yml | 10 +++------- 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 .github/actions/install/action.yml create mode 100644 .github/workflows/examples.yaml diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 00000000..294a0807 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,15 @@ +inputs: + python_version: + description: 'The Python version to use.' + default: '3.11' + +runs: + using: "composite" + steps: + - uses: actions/checkout@v2 + - uses: NiklasRosenstein/slap@gha/install/v1 + - name: Set up Python ${inputs.python_version} + uses: actions/setup-python@v2 + with: { python-version: "${inputs.python_version}" } + - name: Install + run: slap install --no-venv-check diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml new file mode 100644 index 00000000..8bfac948 --- /dev/null +++ b/.github/workflows/examples.yaml @@ -0,0 +1,14 @@ +name: Examples + +on: + push: + branches: [ "develop" ] + tags: [ "*" ] + pull_request: + branches: [ "develop" ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: ./.github/actions/install diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index f64a6d73..297e2697 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -18,13 +18,9 @@ jobs: matrix: python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.x" ] steps: - - uses: actions/checkout@v2 - - uses: NiklasRosenstein/slap@gha/install/v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: { python-version: "${{ matrix.python-version }}" } - - name: Install - run: slap install --no-venv-check + - uses: ./.github/actions/install + with: + python_version: ${{ matrix.python-version }} - name: Test run: slap test From c96ea8c4aa044054136981449a3f4afa4e793d86 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 15:16:35 +0100 Subject: [PATCH 2/7] add actions/checkout --- .github/actions/install/action.yml | 1 - .github/workflows/examples.yaml | 1 + .github/workflows/python.yml | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 294a0807..9ff8dbbb 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -6,7 +6,6 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v2 - uses: NiklasRosenstein/slap@gha/install/v1 - name: Set up Python ${inputs.python_version} uses: actions/setup-python@v2 diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 8bfac948..14b4c3e1 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -11,4 +11,5 @@ jobs: test: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - uses: ./.github/actions/install diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 297e2697..8da818f9 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -18,6 +18,7 @@ jobs: matrix: python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.x" ] steps: + - uses: actions/checkout@v2 - uses: ./.github/actions/install with: python_version: ${{ matrix.python-version }} From 93e7ed0eff95912f49eff1edc6a79d4c35bdcae5 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 15:35:47 +0100 Subject: [PATCH 3/7] pg --- .github/actions/install/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 9ff8dbbb..410fd5e3 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -12,3 +12,4 @@ runs: with: { python-version: "${inputs.python_version}" } - name: Install run: slap install --no-venv-check + shell: bash From 94d116109d6da5fe448ea86b633fd687296a5274 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 15:37:53 +0100 Subject: [PATCH 4/7] maybe --- .github/actions/install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 410fd5e3..35a54eeb 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -9,7 +9,7 @@ runs: - uses: NiklasRosenstein/slap@gha/install/v1 - name: Set up Python ${inputs.python_version} uses: actions/setup-python@v2 - with: { python-version: "${inputs.python_version}" } + with: { python-version: ${inputs.python_version} } - name: Install run: slap install --no-venv-check shell: bash From 58ff46d70bafa9892682023c59ee411609dc8d1a Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 15:41:53 +0100 Subject: [PATCH 5/7] double curly --- .github/actions/install/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 35a54eeb..96d9f08a 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -7,9 +7,9 @@ runs: using: "composite" steps: - uses: NiklasRosenstein/slap@gha/install/v1 - - name: Set up Python ${inputs.python_version} + - name: Set up Python ${{inputs.python_version}} uses: actions/setup-python@v2 - with: { python-version: ${inputs.python_version} } + with: { python-version: "${{inputs.python_version}}" } - name: Install run: slap install --no-venv-check shell: bash From 6ccbff1fd88a60d0e8cabeec8d59dc74cfd83177 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 16:35:33 +0100 Subject: [PATCH 6/7] test build examples --- .github/workflows/examples.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 14b4c3e1..d6597def 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -8,8 +8,28 @@ on: branches: [ "develop" ] jobs: - test: + docusaurs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install + - run: cd examples/docusaurus && pydoc-markdown + - run: cd examples/docusaurus/docusaurus-example && npm install && npm run build + + mkdocs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install + - run: pipx install mkdocs + - run: cd examples/mkdocs && pydoc-markdown + - run: cd examples/mkdocs/build/docs && mkdocs build + + hugo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install + - run: curl https://github.com/gohugoio/hugo/releases/download/v0.120.4/hugo_0.120.4_linux-amd64.tar.gz -L | tar -C /usr/local/bin -xz hugo + - run: cd examples/hugo && pydoc-markdown + - run: cd examples/hugo/build/docs && hugo build From 4221d615411f9b1ad14a4aca5296a7461c2e9b9c Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Sat, 11 Nov 2023 16:42:03 +0100 Subject: [PATCH 7/7] use --build flag in examples ci --- .github/workflows/examples.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index d6597def..2082ec2a 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -15,6 +15,9 @@ jobs: - uses: ./.github/actions/install - run: cd examples/docusaurus && pydoc-markdown - run: cd examples/docusaurus/docusaurus-example && npm install && npm run build + with: + name: docosaurus-site + path: docusaurus-example/build/site mkdocs: runs-on: ubuntu-latest @@ -22,14 +25,18 @@ jobs: - uses: actions/checkout@v2 - uses: ./.github/actions/install - run: pipx install mkdocs - - run: cd examples/mkdocs && pydoc-markdown - - run: cd examples/mkdocs/build/docs && mkdocs build + - run: cd examples/mkdocs && pydoc-markdown --build + - uses: actions/upload-artifact@v3 + with: + name: mkdocs-site + path: build/docs/site hugo: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ./.github/actions/install - - run: curl https://github.com/gohugoio/hugo/releases/download/v0.120.4/hugo_0.120.4_linux-amd64.tar.gz -L | tar -C /usr/local/bin -xz hugo - - run: cd examples/hugo && pydoc-markdown - - run: cd examples/hugo/build/docs && hugo build + - run: cd examples/hugo && pydoc-markdown --build + with: + name: hugo-site + path: build/docs/site