-
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (144 loc) · 5.59 KB
/
open_in_cloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: "Update notebooks for cloud environments"
on:
push:
branches:
- "**"
- "!gh-pages"
- "!open-in-colab"
- "!open-in-kaggle"
pull_request:
branches:
- main
schedule:
- cron: "0 4 * * MON"
workflow_dispatch:
inputs:
branch:
description: "Branch on FEMlium repository"
type: string
jobs:
open_in_colab:
strategy:
matrix:
include:
- backend: none
fem_on_colab_packages: |
gmsh@current
notebook_pattern: |
"**/generate_mesh*.ipynb"
"**/tutorial_*_meshio.ipynb"
- backend: dolfin
fem_on_colab_packages: |
fenics==real@current$dolfin
notebook_pattern: |
"**/tutorial_*_dolfin.ipynb"
- backend: dolfinx
fem_on_colab_packages: |
gmsh@current%dolfinx.io
fenicsx==real@current$dolfinx
notebook_pattern: |
"**/tutorial_*_dolfinx.ipynb"
- backend: firedrake
fem_on_colab_packages: |
firedrake==real@current
notebook_pattern: |
"**/tutorial_*_firedrake.ipynb"
fail-fast: false
uses: fem-on-colab/open-in-colab-workflow/.github/workflows/workflow_call.yml@main
with:
work_directory: open_in_colab
notebook_pattern: ${{ matrix.notebook_pattern }}
notebook_preparation: |
git clone https://github.com/FEMlium/FEMlium.git
cd FEMlium
if [ -n "${{ (inputs || github.event.inputs).branch }}" ]; then
git checkout "${{ (inputs || github.event.inputs).branch }}"
fi
NOTEBOOKS_TO_INCLUDE=""
while read -r PATTERN; do
NOTEBOOKS_TO_INCLUDE="${NOTEBOOKS_TO_INCLUDE} --include=$(echo ${PATTERN} | sed 's|\"||g')"
done <<< $(printf "%s" "${{ matrix.notebook_pattern }}")
rsync -avz --delete --include "*/" ${NOTEBOOKS_TO_INCLUDE} --exclude="*" tutorials ../open_in_colab/
fem_on_colab_packages: ${{ matrix.fem_on_colab_packages }}
pip_packages: |
meshio
viskex@https://github.com/viskex/viskex.git@current
FEMlium@https://github.com/FEMlium/FEMlium.git@current$femlium
test_script: |
apt install -y -qq xvfb
export DISPLAY=":99"
Xvfb $DISPLAY -screen 0 1024x768x24 > /dev/null 2>&1 &
NOTEBOOKS_TO_TEST=""
while read -r PATTERN; do
NOTEBOOKS_TO_TEST="${NOTEBOOKS_TO_TEST} $(find open_in_colab -wholename $(echo ${PATTERN} | sed 's|\"||g'))"
done <<< $(printf "%s" "${{ matrix.notebook_pattern }}")
python3 -m pytest --nbval ${NOTEBOOKS_TO_TEST}
publish_on: github@FEMlium/femlium.github.io@open-in-colab
publish_if_repository: FEMlium/femlium.github.io
open_in_kaggle:
strategy:
matrix:
include:
- backend: none
fem_on_kaggle_packages: |
gmsh@current
notebook_pattern: |
"**/generate_mesh*.ipynb"
"**/tutorial_*_meshio.ipynb"
- backend: dolfin
fem_on_kaggle_packages: |
fenics==real@current$dolfin
notebook_pattern: |
"**/tutorial_*_dolfin.ipynb"
- backend: dolfinx
fem_on_kaggle_packages: |
gmsh@current%dolfinx.io
fenicsx==real@current$dolfinx
notebook_pattern: |
"**/tutorial_*_dolfinx.ipynb"
- backend: firedrake
fem_on_kaggle_packages: |
firedrake==real@current
notebook_pattern: |
"**/tutorial_*_firedrake.ipynb"
fail-fast: false
uses: fem-on-kaggle/open-in-kaggle-workflow/.github/workflows/workflow_call.yml@main
with:
work_directory: open_in_kaggle
notebook_pattern: ${{ matrix.notebook_pattern }}
notebook_preparation: |
git clone https://github.com/FEMlium/FEMlium.git
cd FEMlium
if [ -n "${{ (inputs || github.event.inputs).branch }}" ]; then
git checkout "${{ (inputs || github.event.inputs).branch }}"
fi
NOTEBOOKS_TO_INCLUDE=""
while read -r PATTERN; do
NOTEBOOKS_TO_INCLUDE="${NOTEBOOKS_TO_INCLUDE} --include=$(echo ${PATTERN} | sed 's|\"||g')"
done <<< $(printf "%s" "${{ matrix.notebook_pattern }}")
rsync -avz --delete --include "*/" ${NOTEBOOKS_TO_INCLUDE} --exclude="*" tutorials ../open_in_kaggle/
fem_on_kaggle_packages: ${{ matrix.fem_on_kaggle_packages }}
pip_packages: |
meshio
viskex@https://github.com/viskex/viskex.git@current
FEMlium@https://github.com/FEMlium/FEMlium.git@current$femlium
test_script: |
apt install -y -qq xvfb
export DISPLAY=":99"
Xvfb $DISPLAY -screen 0 1024x768x24 > /dev/null 2>&1 &
NOTEBOOKS_TO_TEST=""
while read -r PATTERN; do
NOTEBOOKS_TO_TEST="${NOTEBOOKS_TO_TEST} $(find open_in_kaggle -wholename $(echo ${PATTERN} | sed 's|\"||g'))"
done <<< $(printf "%s" "${{ matrix.notebook_pattern }}")
python3 -m pytest --nbval ${NOTEBOOKS_TO_TEST}
publish_on: github@FEMlium/femlium.github.io@open-in-kaggle
publish_if_repository: FEMlium/femlium.github.io
warn:
runs-on: ubuntu-latest
if: github.repository == 'FEMlium/femlium.github.io' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
steps:
- name: Warn if scheduled workflow is about to be disabled
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
with:
workflow-filename: open_in_cloud.yml
days-elapsed: 50