Skip to content

Commit cbfe0b4

Browse files
committed
Rebuild models/01-classical_physics.jmd
1 parent e0e6aba commit cbfe0b4

File tree

8 files changed

+117
-20
lines changed

8 files changed

+117
-20
lines changed

html/models/01-classical_physics.html

Lines changed: 17 additions & 17 deletions
Large diffs are not rendered by default.

install_julia.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
3+
set -euxo pipefail
4+
5+
if [[ "$1" == "source" ]]; then
6+
DEBIAN_FRONTEND=noninteractive apt-get -qqy -o=Dpkg::Use-Pty=0 install build-essential cmake gfortran git libatomic1 m4 perl pkg-config python rsync > /dev/null
7+
8+
# Clone to a different folder because julia/deps/srccache might exist already.
9+
git clone ${CI_CLONE_ARGS:-} https://github.com/JuliaLang/julia julia.git
10+
rsync -a julia.git/ julia/
11+
12+
make -C julia -j$(nproc) JULIA_PRECOMPILE=0 ${CI_BUILD_ARGS:-} > /dev/null
13+
ln -s $(pwd)/julia/julia /usr/local/bin/julia
14+
else
15+
case "$CI_RUNNER_EXECUTABLE_ARCH" in
16+
"linux/amd64")
17+
larch="x64"
18+
rarch="x86_64"
19+
nightly_rarch="64"
20+
;;
21+
"linux/arm64")
22+
larch="aarch64"
23+
rarch="aarch64"
24+
nightly_rarch="aarch64"
25+
;;
26+
*)
27+
echo "Unsupported platform: $CI_RUNNER_EXECUTABLE_ARCH" >&2
28+
echo "exit 1"
29+
exit
30+
;;
31+
esac
32+
33+
version="$1"
34+
if [[ "$version" == "nightly" ]]; then
35+
filename="julia-latest-linux$nightly_rarch.tar.gz"
36+
url="https://julialangnightlies-s3.julialang.org/bin/linux/$larch/$filename"
37+
else
38+
filename="julia-$version-latest-linux-$rarch.tar.gz"
39+
url="https://julialang-s3.julialang.org/bin/linux/$larch/$version/$filename"
40+
fi
41+
42+
wget -nv -NP downloads "$url"
43+
tar -C /usr/local --strip-components=1 -zxf "downloads/$filename"
44+
fi
45+
46+
julia -e 'using InteractiveUtils; versioninfo()' >&2
47+
JULIA_LLVM_ARGS='--version' julia >&2
48+
49+
gitignore="$(mktemp)"
50+
cat <<EOF > "$gitignore"
51+
.julia/
52+
downloads/
53+
EOF
54+
cat <<EOF > ~/.gitconfig
55+
[core]
56+
excludesfile = $gitignore
57+
EOF
58+
59+
# https://gitlab.com/gitlab-org/gitlab-runner/issues/327
60+
# https://gitlab.com/gitlab-org/gitlab/issues/16343
61+
echo 'export JULIA_DEPOT_PATH="$CI_PROJECT_DIR/.julia"'
62+
echo 'export JULIA_PROJECT="@."'

markdown/models/01-classical_physics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,14 +758,14 @@ Status `/builds/JuliaGPU/DiffEqTutorials.jl/tutorials/models/Project.toml`
758758
[0c46a032-eb83-5123-abaf-570d42b7fbaa] DifferentialEquations 6.14.0
759759
[31c24e10-a181-5473-b8eb-7969acd0382f] Distributions 0.23.4
760760
[587475ba-b771-5e3f-ad9e-33799f191a9c] Flux 0.10.4
761-
[f6369f11-7733-5829-9624-2563aa707210] ForwardDiff 0.10.10
761+
[f6369f11-7733-5829-9624-2563aa707210] ForwardDiff 0.10.11
762762
[23fbe1c1-3f47-55db-b15f-69d7ec21a316] Latexify 0.13.5
763-
[961ee093-0014-501f-94e3-6117800e7a78] ModelingToolkit 3.10.2
763+
[961ee093-0014-501f-94e3-6117800e7a78] ModelingToolkit 3.11.0
764764
[2774e3e8-f4cf-5e23-947b-6d7e65073b56] NLsolve 4.4.0
765765
[8faf48c0-8b73-11e9-0e63-2155955bfa4d] NeuralNetDiffEq 1.6.0
766766
[429524aa-4258-5aef-a3af-852621145aeb] Optim 0.21.0
767767
[1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] OrdinaryDiffEq 5.41.0
768-
[91a5bcdd-55d7-5caf-9e0b-520d859cae80] Plots 1.4.3
768+
[91a5bcdd-55d7-5caf-9e0b-520d859cae80] Plots 1.4.4
769769
[731186ca-8d62-57ce-b412-fbd966d074cd] RecursiveArrayTools 2.5.0
770770
[789caeaf-c7a9-5a7d-9973-96adeb23e2a0] StochasticDiffEq 6.23.1
771771
[37e2e46d-f89d-539d-b4ee-838fcccc9c8e] LinearAlgebra
-167 Bytes
Loading
-94 Bytes
Loading
-379 Bytes
Loading
-16 Bytes
Binary file not shown.

rebuild.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
k="$(cat $SSH_KEY)"
6+
echo "$k" > "$SSH_KEY"
7+
set -x
8+
chmod 400 "$SSH_KEY"
9+
git config core.sshCommand "ssh -o StrictHostKeyChecking=no -i $SSH_KEY"
10+
git remote add github "[email protected]:$GITHUB_REPOSITORY.git" 2> /dev/null || true
11+
git fetch github
12+
git checkout "github/$FROM"
13+
14+
julia -e "
15+
pushfirst!(LOAD_PATH, \"@.\")
16+
using Pkg
17+
Pkg.instantiate()
18+
using $PACKAGE: weave_file
19+
weave_file(\"$FOLDER\", \"$FILE\")"
20+
21+
if [[ -z "$(git status -suno)" ]]; then
22+
echo "No changes"
23+
exit 0
24+
fi
25+
26+
branch="$(head -c8 /dev/urandom | base64)"
27+
git config user.name "github-actions[bot]"
28+
git config user.email "[email protected]"
29+
git stash -u
30+
git checkout -b "$branch" "github/$TO" 2> /dev/null || git checkout -b "$branch"
31+
git pull github "$TO" 2> /dev/null || true
32+
git stash pop
33+
git add .
34+
git commit -m "Rebuild $FOLDER/$FILE"
35+
git push github "$branch:$TO"

0 commit comments

Comments
 (0)