Skip to content

Commit

Permalink
removed docs, changed Examples to match FMI.jl (#54)
Browse files Browse the repository at this point in the history
* removed docs, changed Examples to match FMI.jl

* removed examples from CI, as they are non existing

* added working export example

* removed dummy link to fmu file download

* added placeholder info to example
  • Loading branch information
0815Creeper authored Nov 4, 2024
1 parent 5abfbd8 commit fe2f8b7
Show file tree
Hide file tree
Showing 17 changed files with 577 additions and 198 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/Documentation.yml

This file was deleted.

178 changes: 127 additions & 51 deletions .github/workflows/Example.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,152 @@
name: Examples v1 (latest)
name: Examples

on:
workflow_run:
workflows: ["Test v1 (latest)"]
types:
- completed
workflow_dispatch:
pull_request:
push:
branches:
- examples

branches:
- main
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/Example.yml'
- 'Project.toml'

jobs:
sync-files:
if: |
${{ (github.event.workflow_run.conclusion == 'success' && github.sha == github.event.workflow_run.head_sha) ||
(github.event_name == 'push' && github.event.head_commit.committer.name != 'github-actions[bot]') }}
jupyter:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
julia-version: ['1.9']
os: [windows-latest] # ubuntu-latest
file-name: [Export-BouncingBall]
julia-version: ['1.10'] # 1.9
julia-arch: [x64]
os: [windows-latest]
experimental: [false]
experimental: [false] # true

steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
ref: examples

- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}

- name: "Build package"
uses: julia-actions/julia-buildpkg@v1
- name: "Install dependencies"
run: julia --project=examples/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

- name: "Install packages"
run: pip install jupyter nbconvert

- name: "Execute notebook"
env:
FILE: examples/jupyter-src/${{ matrix.file-name }}.ipynb
run: jupyter nbconvert --ExecutePreprocessor.kernel_name="julia-${{ matrix.julia-version }}" --to notebook --inplace --execute ${{ env.FILE }}

- name: "Set path filter"
uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
all:
- 'examples/**.ipynb'
changed:
- added|modified: 'examples/**.ipynb'
base: 'examples'
ref: 'examples'

- name: "Execute and synchronize changed files"
if: ${{ github.event_name == 'push' && steps.filter.outputs.changed == 'true' }}
- name: "Export notebook to jl and md"
env:
FILE: examples/jupyter-src/${{ matrix.file-name }}.ipynb
run: |
jupyter nbconvert --ExecutePreprocessor.kernel_name="julia-1.9" --to notebook --inplace --execute ${{ steps.filter.outputs.changed_files }}
jupyter nbconvert --to script ${{ steps.filter.outputs.changed_files }}
jupyter nbconvert --to markdown ${{ steps.filter.outputs.changed_files }}
- name: "Execute and synchronize all files"
if: ${{ github.event_name == 'workflow_run' && steps.filter.outputs.all == 'true'}}
run: |
jupyter nbconvert --ExecutePreprocessor.kernel_name="julia-1.9" --to notebook --inplace --execute ${{ steps.filter.outputs.all_files }}
jupyter nbconvert --to script ${{ steps.filter.outputs.all_files }}
jupyter nbconvert --to markdown ${{ steps.filter.outputs.all_files }}
- name: "Auto commit"
if: ${{ matrix.os == 'ubuntu-latest'}}
uses: stefanzweifel/git-auto-commit-action@v5
jupyter nbconvert --to script ${{ env.FILE }}
jupyter nbconvert --to markdown ${{ env.FILE }}
- name: "run generated jl script to determine success of example building"
run: julia --project=examples/ examples/jupyter-src/${{ matrix.file-name }}.jl

- name: "auto-commit (retry on merge)"
if: success() && github.event_name != 'pull_request' && github.ref_name == 'main'
uses: nick-fields/retry@v3
env:
CI_COMMIT_MESSAGE: jupyter-example-${{ matrix.file-name }}-${{ matrix.os }}-${{ matrix.julia-version }}-${{ matrix.julia-arch }}-${{ matrix.experimental }}[${{ github.ref_name }}]
CI_COMMIT_AUTHOR: github-actions[bot]
EXAMPLES_PATH: examples/jupyter-src
# 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 }}/${{ matrix.file-name }}*
git switch examples
git reset --hard origin/examples
rm -r ${{ env.EXAMPLES_PATH }}/${{ matrix.file-name }}*
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 reset
git add ${{ env.EXAMPLES_PATH }}/${{ matrix.file-name }}*
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@v4

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

- name: "Execute pluto notebooks"
if: ${{ hashFiles('examples/pluto-src/') != '' }}
run: julia -e 'using Pkg; Pkg.add("PlutoSliderServer"); using PlutoSliderServer; PlutoSliderServer.export_directory("examples/pluto-src")'

- name: "auto-commit (retry on merge)"
if: success() && github.event_name != 'pull_request' && github.ref_name == 'main'
uses: nick-fields/retry@v3
env:
CI_COMMIT_MESSAGE: pluto-examples[${{ github.ref_name }}]
CI_COMMIT_AUTHOR: github-actions[bot]
EXAMPLES_PATH: examples/pluto-src
# 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
rm -r ${{ env.EXAMPLES_PATH }}/*
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 reset
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, pluto]
if: github.event_name != 'pull_request' && github.ref_name == 'main'
runs-on: ubuntu-latest
steps:
# Trigger an repoisitory dispath event
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
commit_message: Jupyter nbconvert synch - modified, paired .ipynb files
push_options: '--force-with-lease'
token: ${{ secrets.FMI_DOC_TRIGGER_PAT }}
repository: 'ThummeTo/FMI.jl'
event-type: trigger-docu
16 changes: 16 additions & 0 deletions .github/workflows/Formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Format suggestions
on:
pull_request:
# this argument is not required if you don't use the `suggestion-label` input
types: [ opened, reopened, synchronize, labeled, unlabeled ]
workflow_dispatch:

jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/julia-format@v3
with:
version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1')
suggestion-label: 'format-suggest' # leave this unset or empty to show suggestions for all PRs

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ docs/site/
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
LocalPreferences.toml

# Custom
tmp/
.vscode/settings.json
examples/jupyter-src/.ipynb_checkpoints/
1 change: 0 additions & 1 deletion docs/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions docs/Project.toml

This file was deleted.

40 changes: 0 additions & 40 deletions docs/make.jl

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/contents.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/src/examples/overview.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/src/faq.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/src/features.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/library.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/src/related.md

This file was deleted.

Loading

0 comments on commit fe2f8b7

Please sign in to comment.