Skip to content

Commit

Permalink
added working export example
Browse files Browse the repository at this point in the history
  • Loading branch information
0815Creeper committed Oct 30, 2024
1 parent 1c70dde commit 6b15425
Show file tree
Hide file tree
Showing 3 changed files with 488 additions and 3 deletions.
55 changes: 52 additions & 3 deletions .github/workflows/Example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest] # ubuntu-latest
file-name: []
file-name: [Export-BouncingBall]
julia-version: ['1.10'] # 1.9
julia-arch: [x64]
experimental: [false] # true
Expand Down Expand Up @@ -89,8 +89,57 @@ jobs:
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]
needs: [jupyter, pluto]
if: github.event_name != 'pull_request' && github.ref_name == 'main'
runs-on: ubuntu-latest
steps:
Expand All @@ -99,5 +148,5 @@ jobs:
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.FMI_DOC_TRIGGER_PAT }}
repository: 'ThummeTo/FMIExport.jl'
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

Loading

0 comments on commit 6b15425

Please sign in to comment.