-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #57. Linked PR: mesh-adaptation/docs#59. This PR sets up UM2N's CI to use the newly added bespoke Docker image. It also makes use of the reusable test workflow from the docs repo.
- Loading branch information
1 parent
05b98e9
commit f7f7963
Showing
6 changed files
with
57 additions
and
57 deletions.
There are no files selected for viewing
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
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 |
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
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 . |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.