Skip to content

Commit 0cc6af4

Browse files
Sync with FEM on Colab website: fem-on-colab/fem-on-colab.github.io@1194d69
1 parent d4db4e3 commit 0cc6af4

File tree

4 files changed

+152
-137
lines changed

4 files changed

+152
-137
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "CI"
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
- "!gh-pages"
8+
pull_request:
9+
branches:
10+
- main
11+
schedule:
12+
- cron: "0 1 * * MON"
13+
workflow_dispatch:
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install dependencies
21+
run: |
22+
python3 -m pip -q install yamllint
23+
- name: Run yamllint
24+
run: |
25+
python3 -m yamllint -d "{extends: default, rules: {document-start: {present: false}, line-length: disable, truthy: {check-keys: false}}}" .
26+
27+
warn:
28+
runs-on: ubuntu-latest
29+
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
30+
steps:
31+
- name: Warn if scheduled workflow is about to be disabled
32+
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
33+
with:
34+
workflow-filename: ci.yml
35+
days-elapsed: 50

.github/workflows/stats.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,57 @@ jobs:
99
stats:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Clone website repository on current branch
13-
uses: actions/checkout@v4
14-
with:
15-
fetch-depth: 0
16-
- name: Clone website repository on stats branch
17-
uses: actions/checkout@v4
18-
with:
19-
ref: stats
20-
fetch-depth: 0
21-
path: _build/stats
22-
- name: Install dependencies
23-
run: |
24-
wget https://github.com/fem-on-colab/release-download-count-script/raw/main/scripts/requirements.txt
25-
python3 -m pip -q install -r requirements.txt
26-
rm requirements.txt
27-
python3 -m pip -q install pandas
28-
SITE_PACKAGES=$(python3 -c 'import site; print(site.getsitepackages()[0])')
29-
sudo wget https://github.com/fem-on-colab/release-download-count-script/raw/main/scripts/release_download_count.py -P $SITE_PACKAGES
30-
- name: Update release download stats
31-
run: |
32-
pushd _stats
33-
ln -s ../_build/stats/stats.csv stats.csv
34-
TOKEN="${{ github.token }}" python3 stats.py
35-
popd
36-
- name: Deploy to GitHub branch
37-
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main'
38-
run: |
39-
SHA_SHORT=$(git rev-parse --short HEAD)
40-
pushd _build/stats
41-
git config user.name "GitHub Actions"
42-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43-
git add .
44-
git pull origin stats
45-
[ -n "$(git status --porcelain=v1 2>/dev/null)" ] && git commit -m "deploy: ${SHA_SHORT}"
46-
git push origin stats
47-
popd
48-
shell: bash
49-
- name: Deploy to GitHub artifacts
50-
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref != 'refs/heads/main'
51-
uses: actions/upload-artifact@v3
52-
with:
53-
name: stats
54-
path: _build/stats
55-
retention-days: 1
12+
- name: Clone website repository on current branch
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Clone website repository on stats branch
17+
uses: actions/checkout@v4
18+
with:
19+
ref: stats
20+
fetch-depth: 0
21+
path: _build/stats
22+
- name: Install dependencies
23+
run: |
24+
wget https://github.com/fem-on-colab/release-download-count-script/raw/main/scripts/requirements.txt
25+
python3 -m pip -q install -r requirements.txt
26+
rm requirements.txt
27+
python3 -m pip -q install pandas
28+
SITE_PACKAGES=$(python3 -c 'import site; print(site.getsitepackages()[0])')
29+
sudo wget https://github.com/fem-on-colab/release-download-count-script/raw/main/scripts/release_download_count.py -P $SITE_PACKAGES
30+
- name: Update release download stats
31+
run: |
32+
pushd _stats
33+
ln -s ../_build/stats/stats.csv stats.csv
34+
TOKEN="${{ github.token }}" python3 stats.py
35+
popd
36+
- name: Deploy to GitHub branch
37+
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main'
38+
run: |
39+
SHA_SHORT=$(git rev-parse --short HEAD)
40+
pushd _build/stats
41+
git config user.name "GitHub Actions"
42+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
git add .
44+
git pull origin stats
45+
[ -n "$(git status --porcelain=v1 2>/dev/null)" ] && git commit -m "deploy: ${SHA_SHORT}"
46+
git push origin stats
47+
popd
48+
shell: bash
49+
- name: Deploy to GitHub artifacts
50+
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref != 'refs/heads/main'
51+
uses: actions/upload-artifact@v3
52+
with:
53+
name: stats
54+
path: _build/stats
55+
retention-days: 1
5656

5757
warn:
5858
runs-on: ubuntu-latest
5959
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
6060
steps:
61-
- name: Warn if scheduled workflow is about to be disabled
62-
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
63-
with:
64-
workflow-filename: stats.yml
65-
days-elapsed: 50
61+
- name: Warn if scheduled workflow is about to be disabled
62+
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
63+
with:
64+
workflow-filename: stats.yml
65+
days-elapsed: 50

.github/workflows/website.yml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -17,76 +17,76 @@ jobs:
1717
website:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- name: Clone website repository on current branch
21-
uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0
24-
- name: Clone website repository on stats branch
25-
uses: actions/checkout@v4
26-
with:
27-
ref: stats
28-
fetch-depth: 0
29-
path: _build/stats
30-
- name: Clone website repository on gh-pages branch
31-
uses: actions/checkout@v4
32-
with:
33-
ref: gh-pages
34-
fetch-depth: 0
35-
path: _build/html
36-
- name: Install dependencies
37-
run: |
38-
pip3 -q install pandas plotly sphinx-material
39-
- name: Generate sphinx website
40-
run: |
41-
pushd _stats
42-
ln -s ../_build/stats/stats.csv stats.csv
43-
popd
44-
rm -rf _build/html/* && make html
45-
- name: Fix permissions
46-
run: |
47-
sudo chown $USER _build -R
48-
- name: Check that no releases or notebooks have been deleted
49-
run: |
50-
pushd _build/html
51-
if [[ $(git ls-files --deleted releases | wc -l) -gt 0 ]]; then
52-
echo "The following releases have been deleted:"
53-
git ls-files --deleted releases
54-
exit 1
55-
fi
56-
if [[ $(git ls-files --deleted tests | wc -l) -gt 0 ]]; then
57-
echo "The following notebooks have been deleted:"
58-
git ls-files --deleted tests
59-
exit 1
60-
fi
61-
popd
62-
shell: bash
63-
- name: Deploy to GitHub pages
64-
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main'
65-
run: |
66-
SHA_SHORT=$(git rev-parse --short HEAD)
67-
pushd _build/html
68-
git config user.name "GitHub Actions"
69-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
70-
git add .
71-
git pull origin gh-pages
72-
[ -n "$(git status --porcelain=v1 2>/dev/null)" ] && git commit -m "deploy: ${SHA_SHORT}"
73-
git push origin gh-pages
74-
popd
75-
shell: bash
76-
- name: Deploy to GitHub artifacts
77-
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref != 'refs/heads/main'
78-
uses: actions/upload-artifact@v3
79-
with:
80-
name: website
81-
path: _build/html
82-
retention-days: 1
20+
- name: Clone website repository on current branch
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Clone website repository on stats branch
25+
uses: actions/checkout@v4
26+
with:
27+
ref: stats
28+
fetch-depth: 0
29+
path: _build/stats
30+
- name: Clone website repository on gh-pages branch
31+
uses: actions/checkout@v4
32+
with:
33+
ref: gh-pages
34+
fetch-depth: 0
35+
path: _build/html
36+
- name: Install dependencies
37+
run: |
38+
pip3 -q install pandas plotly sphinx-material
39+
- name: Generate sphinx website
40+
run: |
41+
pushd _stats
42+
ln -s ../_build/stats/stats.csv stats.csv
43+
popd
44+
rm -rf _build/html/* && python3 -m sphinx -W -b html . _build/html
45+
- name: Fix permissions
46+
run: |
47+
sudo chown $USER _build -R
48+
- name: Check that no releases or notebooks have been deleted
49+
run: |
50+
pushd _build/html
51+
if [[ $(git ls-files --deleted releases | wc -l) -gt 0 ]]; then
52+
echo "The following releases have been deleted:"
53+
git ls-files --deleted releases
54+
exit 1
55+
fi
56+
if [[ $(git ls-files --deleted tests | wc -l) -gt 0 ]]; then
57+
echo "The following notebooks have been deleted:"
58+
git ls-files --deleted tests
59+
exit 1
60+
fi
61+
popd
62+
shell: bash
63+
- name: Deploy to GitHub pages
64+
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main'
65+
run: |
66+
SHA_SHORT=$(git rev-parse --short HEAD)
67+
pushd _build/html
68+
git config user.name "GitHub Actions"
69+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
70+
git add .
71+
git pull origin gh-pages
72+
[ -n "$(git status --porcelain=v1 2>/dev/null)" ] && git commit -m "deploy: ${SHA_SHORT}"
73+
git push origin gh-pages
74+
popd
75+
shell: bash
76+
- name: Deploy to GitHub artifacts
77+
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref != 'refs/heads/main'
78+
uses: actions/upload-artifact@v3
79+
with:
80+
name: website
81+
path: _build/html
82+
retention-days: 1
8383

8484
warn:
8585
runs-on: ubuntu-latest
8686
if: github.repository == 'fem-on-kaggle/fem-on-kaggle.github.io' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
8787
steps:
88-
- name: Warn if scheduled workflow is about to be disabled
89-
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
90-
with:
91-
workflow-filename: website.yml
92-
days-elapsed: 50
88+
- name: Warn if scheduled workflow is about to be disabled
89+
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
90+
with:
91+
workflow-filename: website.yml
92+
days-elapsed: 50

Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)