correct repo name #286
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and build | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 7 * * 1" | |
jobs: | |
style-checks: | |
name: Run style checks | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt-get install -y python3-setuptools python3-pip python3-flake8 | |
name: Install dependencies | |
- uses: actions/checkout@v3 | |
- run: pip3 install -r requirements.txt | |
name: Install requirements | |
- run: | | |
python3 -m flake8 builder | |
python3 -m flake8 build.py | |
name: Flake8 checks on builder | |
- run: python3 -m flake8 test | |
name: Flake8 checks on tests | |
test-build-website: | |
name: Test building of defelement.com | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt-get install -y python3-setuptools python3-pip | |
name: Install dependencies | |
- uses: actions/checkout@v3 | |
- name: Load Symfem cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/.cache/symfem | |
key: symfem-cache | |
- name: Clone Symfem | |
uses: actions/checkout@v3 | |
with: | |
path: ./symfem | |
repository: mscroggs/symfem | |
ref: main | |
- name: Install Symfem | |
run: | | |
cd symfem | |
pip3 install .[optional] | |
- run: mkdir -p ~/.local/share/fonts | |
name: Make font folder | |
- name: Clone Varela Round | |
uses: actions/checkout@v3 | |
with: | |
path: ./varela-r | |
repository: avrahamcornfeld/Varela-Round-Hebrew | |
ref: master | |
- run: cp varela-r/fonts/VarelaRound-Regular.otf ~/.local/share/fonts/ | |
name: Install Varela Round | |
- name: Download and install Computer Modern | |
run: | | |
wget https://downloads.sourceforge.net/project/cm-unicode/cm-unicode/0.7.0/cm-unicode-0.7.0-otf.tar.xz | |
tar -xf cm-unicode-0.7.0-otf.tar.xz | |
cp cm-unicode-0.7.0/cmunti.otf ~/.local/share/fonts/ | |
- run: pip3 install -r requirements.txt | |
name: Install requirements | |
- run: python3 build.py _test_html --test auto --processes 4 | |
name: Build website HTML | |
build-website: | |
name: Build defelement.com | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' | |
needs: | |
- test-build-website | |
- run-tests | |
steps: | |
- run: sudo apt-get install -y python3-setuptools python3-pip | |
name: Install dependencies | |
- uses: actions/checkout@v3 | |
- name: Load Symfem cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/.cache/symfem | |
key: symfem-cache | |
- name: Clone Symfem | |
uses: actions/checkout@v3 | |
with: | |
path: ./symfem | |
repository: mscroggs/symfem | |
ref: main | |
- name: Install Symfem | |
run: | | |
cd symfem | |
pip3 install .[optional] | |
- run: mkdir -p ~/.local/share/fonts | |
name: Make font folder | |
- name: Clone Varela Round | |
uses: actions/checkout@v3 | |
with: | |
path: ./varela-r | |
repository: avrahamcornfeld/Varela-Round-Hebrew | |
ref: master | |
- run: cp varela-r/fonts/VarelaRound-Regular.otf ~/.local/share/fonts/ | |
name: Install Varela Round | |
- name: Download and install Computer Modern | |
run: | | |
wget https://downloads.sourceforge.net/project/cm-unicode/cm-unicode/0.7.0/cm-unicode-0.7.0-otf.tar.xz | |
tar -xf cm-unicode-0.7.0-otf.tar.xz | |
cp cm-unicode-0.7.0/cmunti.otf ~/.local/share/fonts/ | |
- run: pip3 install -r requirements.txt | |
name: Install requirements | |
- run: python3 build.py _html --github-token ${{ secrets.bot_github_token }} --processes 4 | |
name: Build website HTML | |
if: ${{ !github.event.pull_request.head.repo.fork }} | |
- run: python3 build.py _html --processes 4 | |
name: Build website HTML | |
if: ${{ github.event.pull_request.head.repo.fork }} | |
verification: | |
name: Run verification | |
runs-on: ubuntu-latest | |
env: | |
CC: gcc-10 | |
CXX: g++-10 | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- uses: actions/checkout@v3 | |
- name: Install requirements | |
run: pip3 install "numpy>=1.21,<1.23" scipy numba>=0.55.2 meshio>=4.0.16 | |
- name: Load Symfem cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/.cache/symfem | |
key: symfem-cache | |
- name: Clone Symfem | |
uses: actions/checkout@v3 | |
with: | |
path: ./symfem | |
repository: mscroggs/symfem | |
ref: main | |
- name: Install Symfem | |
run: | | |
cd symfem | |
pip3 install .[optional] | |
- name: Install Basix | |
run: | | |
sudo apt-get install -y libopenblas-dev liblapack-dev ninja-build | |
pip3 install pybind11 | |
pip3 install git+https://github.com/FEniCS/basix.git | |
- name: Install UFL | |
run: pip3 install git+https://github.com/FEniCS/ufl.git | |
- name: Install Bempp-cl | |
run: pip3 install git+https://github.com/bempp/bempp-cl.git | |
- run: pip3 install -r requirements.txt | |
name: Install requirements | |
- run: mkdir ../verification | |
name: Make dir | |
- run: python3 verify.py ../verification/verification.json --processes 4 | |
name: Run verification | |
- run: | | |
cd ../verification | |
git config --global user.email "[email protected]" | |
git config --global user.name "Finite Element Bot" | |
git init | |
git checkout -b verification | |
git add . | |
git commit -m "verification.json" | |
git remote add origin https://symfembot:${{ secrets.bot_github_token }}@github.com/mscroggs/defelement.com.git | |
git push -u origin verification --force | |
name: Push to GitHub | |
build-and-push-website: | |
name: Build and deploy defelement.com | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: verification | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
steps: | |
- run: sudo apt-get install -y python3-setuptools python3-pip | |
name: Install dependencies | |
- uses: actions/checkout@v3 | |
- name: Load Symfem cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/.cache/symfem | |
key: symfem-cache | |
- name: Clone Symfem | |
uses: actions/checkout@v3 | |
with: | |
path: ./symfem | |
repository: mscroggs/symfem | |
ref: main | |
- name: Install Symfem | |
run: | | |
cd symfem | |
pip3 install .[optional] | |
- name: Clone verification | |
uses: actions/checkout@v3 | |
with: | |
path: ./verification | |
repository: mscroggs/defelement.com | |
ref: verification | |
- run: mkdir -p ~/.local/share/fonts | |
name: Make font folder | |
- name: Clone Varela Round | |
uses: actions/checkout@v3 | |
with: | |
path: ./varela-r | |
repository: avrahamcornfeld/Varela-Round-Hebrew | |
ref: master | |
- run: cp varela-r/fonts/VarelaRound-Regular.otf ~/.local/share/fonts/ | |
name: Install Varela Round | |
- name: Download and install Computer Modern | |
run: | | |
wget https://downloads.sourceforge.net/project/cm-unicode/cm-unicode/0.7.0/cm-unicode-0.7.0-otf.tar.xz | |
tar -xf cm-unicode-0.7.0-otf.tar.xz | |
cp cm-unicode-0.7.0/cmunti.otf ~/.local/share/fonts/ | |
- run: pip3 install -r requirements.txt | |
name: Install requirements | |
- run: python3 build.py _html --verification-json verification/verification.json --github-token ${{ secrets.bot_github_token }} --processes 4 | |
name: Build website HTML | |
# Push to GitHub Pages | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: '_html' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
- name: Save matrix cache | |
id: cache-save | |
uses: actions/cache/save@v3 | |
with: | |
path: /home/runner/.cache/symfem | |
key: symfem-cache-${{ github.run_id }} | |
restore-keys: symfem-cache | |
run-tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
env: | |
CC: gcc-10 | |
CXX: g++-10 | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- uses: actions/checkout@v3 | |
- run: pip3 install pytest-xdist | |
name: Install dependencies | |
- name: Install requirements | |
run: pip3 install "numpy>=1.21,<1.23" scipy numba>=0.55.2 meshio>=4.0.16 | |
- name: Load Symfem cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: /home/runner/.cache/symfem | |
key: symfem-cache | |
- name: Clone Symfem | |
uses: actions/checkout@v3 | |
with: | |
path: ./symfem | |
repository: mscroggs/symfem | |
ref: main | |
- name: Install Symfem | |
run: | | |
cd symfem | |
pip3 install .[optional] | |
- name: Install Basix | |
run: | | |
sudo apt-get install -y libopenblas-dev liblapack-dev ninja-build | |
pip3 install pybind11 | |
pip3 install git+https://github.com/FEniCS/basix.git | |
- name: Install UFL | |
run: pip3 install git+https://github.com/FEniCS/ufl.git | |
- name: Install Bempp-cl | |
run: pip3 install git+https://github.com/bempp/bempp-cl.git | |
- name: Install LaTeΧ | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y texlive-latex-base | |
- run: pip3 install -r requirements.txt | |
name: Install requirements | |
- run: python3 -m pytest -n4 test | |
name: Run tests with pytest |