Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the UM2N Docker image #59

Merged
merged 5 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 22 additions & 54 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,31 @@
name: Install and test UM2N
name: 'Run UM2N Test Suite'

on:
# Run test suite whenever main is updated
push:
branches:
- main

# Run test suite whenever commits are pushed to an open PR
pull_request:

jobs:
test-warpmesh:
name: Test UM2N
runs-on: ubuntu-latest
container:
image: firedrakeproject/firedrake:latest
options: --user root
steps:
- uses: actions/checkout@v3

- name: Cleanup
if: ${{ always() }}
run: |
cd ..
rm -rf build

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Lint check
if: ${{ always() }}
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install ruff
ruff check

- name: Install Movement
run: |
. /home/firedrake/firedrake/bin/activate
git clone https://github.com/mesh-adaptation/movement.git
cd movement
python3 -m pip install -e .
# Run test suite every Sunday at 1AM
schedule:
- cron: '0 1 * * 0'

- name: Install PyTorch
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu

- name: Install PyTorch3d
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install 'git+https://github.com/facebookresearch/pytorch3d.git'

- name: Install UM2N
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install -e .

- name: Run UM2N test suite
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pytest tests/test* -v
jobs:
test_suite:
uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_test_suite.yml@main
with:
install-command: 'python -m pip uninstall -y UM2N && python -m pip install -e .'
test-command: |
export GITHUB_ACTIONS_TEST_RUN=1
python $(which firedrake-clean)
python -m coverage erase
python -m coverage run -a --source=UM2N -m pytest -v --durations=20 test
python -m coverage report
changed-files-patterns: |
**/*.py
**/*.msh
**/*.geo
docker-image: firedrake-um2n
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
all: install

.PHONY: install test

install:
@echo "Installing UM2N..."
@python3 -m pip install -e .
@echo "Done."
@echo "Setting up pre-commit..."
@pre-commit install
@echo "Done."

lint:
@echo "Checking lint..."
@ruff check
@echo "PASS"

test: lint
@echo "Running all tests..."
@python3 -m pytest -v --durations=20 test
@echo "Done."

coverage:
@echo "Generating coverage report..."
@python3 -m coverage erase
@python3 -m coverage run --source=UM2N -m pytest -v test
@python3 -m coverage html
@echo "Done."

tree:
@tree -d .
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ The documentation is generated by Sphinx. To build the documentation, under the
├── docs (Documentation)
│ ├── conf.py
│ └── index.rst
├── play
│ ├── play_conv_feat.py
│ └── play_dataset.py
├── script (Utility scripts)
│ ├── make_dataset.sh (Script for making datasets of different sizes)
│ ├── build_helmholtz_dataset.py (Build helmholtz dataset)
Expand All @@ -159,9 +162,7 @@ The documentation is generated by Sphinx. To build the documentation, under the
│ ├── plot.py
│ ├── train_model.py
│ └── ...
├── tests
│ ├── play_conv_feat.py
│ ├── play_dataset.py
├── test
│ ├── test_import.py
│ └── ...
├── install.sh (Installation script for UM2N and its dependencies)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading