Updated gem-elecrtric-motor with gem-control docs #285
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
| name: Build | |
| on: | |
| workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
| push: | |
| branches: [ master, nightly ] | |
| pull_request: | |
| branches: [ master, nightly ] | |
| jobs: | |
| test-code: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt --prefer-binary; fi | |
| python -m pip install . | |
| - name: Test with pytest | |
| env: | |
| PY_VER: ${{ matrix.python-version }} | |
| run: | | |
| pytest | |
| build-doc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build Sphinx documentation | |
| uses: nicholasphair/sphinx-action@7.0.0 | |
| with: | |
| pre-build-command: export QT_QPA_PLATFORM=offscreen && apt-get update && apt-get install -y git python3-tk tcl8.6 tk8.6 libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 libnss3 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 && python -m pip install --upgrade pip setuptools wheel && python -m pip install sphinx sphinx_rtd_theme==1.3.0 myst-parser ipython m2r2 && python -m pip install -r requirements.txt && python -m pip install git+https://github.com/upb-lea/gem-control@main && python -m pip install git+https://github.com/upb-lea/control-block-diagram && python -m pip install . | |
| docs-folder: docs | |
| build-command: sphinx-build -b html -W -n -T -v docs _build/html | |
| - name: Commit documentation changes | |
| run: | | |
| git clone https://github.com/upb-lea/gym-electric-motor.git --branch gh-pages --single-branch gh-pages | |
| cp -r docs/_build/html/* gh-pages/ | |
| cd gh-pages | |
| touch .nojekyll | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add . | |
| git commit -m "Update documentation" -a || true | |
| # The above command will fail if no changes were present, so we ignore | |
| # that. | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| branch: gh-pages | |
| directory: gh-pages | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # =============================== |