Cleanups, updates to documentation, UV, remove ununsed modules #264
Workflow file for this run
This file contains hidden or 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
| # Build documentation | |
| name: Build and upload documentation | |
| defaults: | |
| run: | |
| shell: bash | |
| on: # Runs on any push event in a PR or any push event to master | |
| pull_request: | |
| push: | |
| branches: | |
| - 'master' | |
| jobs: | |
| documentation: | |
| runs-on: ubuntu-latest | |
| env: | |
| python-version: 3.12 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update apt | |
| run: sudo apt-get update | |
| - name: Install LaTeX | |
| run: sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended # texlive-fonts-extra texlive-latex-recommended ghostscript | |
| - name: Install optipng, dvipng and cm-super | |
| run: sudo apt-get install -y optipng dvipng cm-super | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: pyproject.toml | |
| - name: Set up Python ${{ env.python-version }} | |
| run: uv python install ${{ env.python-version }} | |
| - name: Install package with test dependencies | |
| run: uv sync --all-extras --dev | |
| - name: Get acc-models-lhc | |
| run: git clone -b 2022 https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1 | |
| - name: Move acc-models-lhc to examples folder | |
| run: mv acc-models-lhc examples/ | |
| - name: Build documentation | |
| continue-on-error: true | |
| run: make docs | |
| # Upload artifacts if in PR so reviewers can have a quick look without building documentation from the branch locally | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: success() && github.event_name == 'pull_request' # only for pushes in PR | |
| with: | |
| name: site-build | |
| path: doc_build | |
| retention-days: 5 | |
| # Upload the doc to github pages branch and publish if from a push to master | |
| - name: Upload documentation to gh-pages | |
| if: success() && github.ref == 'refs/heads/master' # only for pushes to master | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: gh-pages | |
| folder: doc_build |