Skip to content

Commit

Permalink
Fix documentation upload to github pages (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
grzanka authored Mar 27, 2024
1 parent 31bea78 commit 1bc5dcd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 40 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
if: >
!contains(github.event.head_commit.message, '[ci skip]') &&
!contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -38,9 +38,9 @@ jobs:
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics pymchelper tests examples
- name: Smoke test with pytest
run: |
run: |
pytest -k "smoke" tests/
# all tests on matrix of all possible python versions and OSes
normal_test:
strategy:
Expand Down Expand Up @@ -73,6 +73,5 @@ jobs:
pip install -r tests/requirements-test.txt
- name: Test with pytest
run: |
run: |
pytest -k "not slow" tests/
12 changes: 6 additions & 6 deletions .github/workflows/release-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ jobs:
artifacts: './dist/*'
token: ${{ secrets.GITHUB_TOKEN }}


generate-deb-packages:
runs-on: ubuntu-latest
needs: [build-executables]

steps:
- name: Checkout repository with full history
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: executables
Expand Down Expand Up @@ -132,13 +132,13 @@ jobs:
with:
name: deb
path: debian_packages/

- name: Import GPG key from a secret variable
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Print GPG user IDs and save files to be included in repository
working-directory: debian_packages
run: |
Expand Down
41 changes: 16 additions & 25 deletions .github/workflows/release-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
pip install -r tests/requirements-test.txt
- name: Run all test with pytest
run: |
run: |
pytest -k "slow" tests/
- name: Check images generation for documentation
run: |
run: |
cd docs/images_generation && ./run.sh
# test if package generation works and optional package upload to pypi (only on release)
Expand All @@ -47,24 +47,24 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Make wheel package and validate it
run: |
run: |
pip install wheel twine
# first call to version method would generate VERSION file
PYTHONPATH=. python pymchelper/run.py --version
python setup.py bdist_wheel
twine check dist/*.whl
Expand All @@ -87,28 +87,19 @@ jobs:
docs:
runs-on: ubuntu-latest
needs: [make_and_upload_package]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
id-token: write
pages: write
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
fetch-depth: 0 # fetch all history, as by default only last 1 commit is fetched
- name: Build and Commit
uses: sphinx-notes/[email protected]
with:
documentation_path: docs
requirements_path: docs/requirements.txt
- name: Push changes to gh-pages branch
# this action is being triggered on release tags (named v*)
if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')"
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
checkout: false
python_version: '3.10'
2 changes: 1 addition & 1 deletion .github/workflows/release-win-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: python3 setup.py --help

- name: Install pyinstaller
run: pip install pyinstaller
run: pip install pyinstaller

- name: Prepare requierements
run: pip install -r requirements.txt
Expand Down
5 changes: 2 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ Welcome to pymchelper's documentation!
such as FLUKA or SHIELD-HIT12A.
It provides a command line program, called **convertmc** which simplifies process of converting binary output
files to graphs, tabulated plain data and MS Excel files and other formats.
Toolkit can also serve as a library in the Python language, which can be used by programmers and data scientists
Toolkit can also serve as a library in the Python language, which can be used by programmers and data scientists
to process output data in Python scripts.


.. toctree::
:maxdepth: 2

getting_started.rst
user_guide.rst
install.rst
developer.rst


0 comments on commit 1bc5dcd

Please sign in to comment.