Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pluto implementation for CI #5

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions .github/workflows/Example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- main
paths:
- 'src/**'
- 'examples/src/**'
- 'examples/**'
- '.github/workflows/Example.yml'
- 'Project.toml'

Expand Down Expand Up @@ -81,9 +81,55 @@ jobs:
git add ${{ env.EXAMPLES_PATH }}
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push origin examples || (git reset --soft HEAD~1 && (exit 1))


pluto:
runs-on: ubuntu-latest
steps:
- name: "Check out repository"
uses: actions/checkout@v3

- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: '1.10'

- run: julia -e 'using Pkg; Pkg.add("PlutoSliderServer"); Pkg.add("FMI")'
- run: julia -e 'using PlutoSliderServer; PlutoSliderServer.export_directory("examples/pluto-src")'

- name: "auto-commit (retry on merge)"
if: success() && github.event_name != 'pull_request' && github.branch == 'main'
uses: nick-fields/retry@v3
env:
CI_COMMIT_MESSAGE: examples-pluto[${{ github.ref }}]
CI_COMMIT_AUTHOR: github-actions[bot]
EXAMPLES_PATH: examples
# Fetch all and clear the stash list. Include all files from the examples folder to the stash and switch the branch.
# Reset the branch and remove all current files in the examples folder.
# Checkout the last stash to restore the new notebooks and apply the stash index to restore all other new files in the folder.
with:
timeout_minutes: 999
max_attempts: 10
warning_on_retry: false
shell: bash
command: |
git fetch --all
git stash clear
git stash --include-untracked -- ${{ env.EXAMPLES_PATH }}
git switch examples
git reset --hard origin/examples
git checkout stash -f -- ${{ env.EXAMPLES_PATH }}
git stash apply --index
git stash drop
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_AUTHOR }}@users.noreply.github.com"
git config --global core.autocrlf false
git pull
git add ${{ env.EXAMPLES_PATH }}
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push origin examples || (git reset --soft HEAD~1 && (exit 1))

call-docu:
needs: jupyter
needs: [jupyter, pluto]
if: github.event_name != 'pull_request' && github.branch == 'main'
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ example_pages = [
"Manipulation" => "examples/manipulation.md",
"Multithreading" => "examples/multithreading.md",
"Multiprocessing" => "examples/multiprocessing.md",
"Pluto Workshops" => "examples/workshops.md",
]

makedocs(
Expand Down
7 changes: 6 additions & 1 deletion docs/src/examples/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This section discusses the included examples of the FMI.jl library.
If you require further information about the function calls, see the function sections of the [library](https://thummeto.github.io/FMI.jl/dev/library/).

Examples are subdevided into *Basics*, *Advanced* and *Publication appendices*.
Examples are subdevided into *Basics*, *Advanced*, *Pluto workshops* and *Publication appendices*.


**Basic examples:**
Expand All @@ -22,6 +22,11 @@ Examples are subdevided into *Basics*, *Advanced* and *Publication appendices*.
- [__Multiprocessing__](https://thummeto.github.io/FMI.jl/dev/examples/multiprocessing/): Shows how to use multiprocessing to simulate multiple FMUs.


**Pluto workshops:**

- [__Pluto workshops__](https://thummeto.github.io/FMI.jl/dev/examples/workshops/): [Pluto](https://plutojl.org/) based notebooks, that can easyly be executed on your own Pluto-Setup.


**Publication appendices:**

- [__Modelica conference 2021__](https://thummeto.github.io/FMI.jl/dev/examples/modelica_conference_2021/): Showing the different variants of simulating an FMU.
4 changes: 4 additions & 0 deletions docs/src/examples/workshops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Pluto](https://plutojl.org/) based notebooks, that can easyly be executed on your own Pluto-Setup.
```@raw html
<iframe src="../pluto-src/index.html" style="height:500px;width:100%;"></iframe>
```
Loading