Repository: flatsurf/surface-dynamics (language: python)

Issue:
write CI and test with pyeantic and pyintervalxt
See the discussion at https://gitlab.com/videlec/surface_dynamics/-/issues/17


Discussion / hints:

Fix patch:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 347ea922..00000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-before_script:
-  - export MAKEFLAGS="-j2"
-
-test:dev: &test
-  image: sagemath/sagemath-dev:develop
-  script:
-    - sage -c 'import sage.env; print(sage.env.SAGE_VERSION)'
-    - sage -pip install pytest
-    - sage -pip install .
-    - export SURFACE_DYNAMICS_PATH="$(pwd)"
-    - export SURFACE_DYNAMICS_INSTALL="$(sage -c 'import surface_dynamics; print(surface_dynamics.__path__[0])')"
-    # tests without gap_packages
-    - cd
-    - sage -t --force-lib --long ${SURFACE_DYNAMICS_INSTALL}
-    - cd ${SURFACE_DYNAMICS_PATH}/tests
-    - sage -python -m pytest -v
-    # tests with gap_packages
-    - sage -i gap_packages
-    - cd
-    - sage -t --force-lib --long ${SURFACE_DYNAMICS_INSTALL}
-    - sage -t --force-lib --long ${SURFACE_DYNAMICS_PATH}/README.rst
-    - cd ${SURFACE_DYNAMICS_PATH}/tests
-    - sage -python -m pytest -v
-
-test:9.0:
-  << : *test
-  image: sagemath/sagemath-dev:9.0
-
-# NOTE: 8.9-dev image is absent or misconfigured in docker hub...
-# We just disable it for now
-#test:8.9:
-#  << : *test
-#  image: sagemath/sagemath-dev:8.9
-
-test:8.8:
-  << : *test
-  image: sagemath/sagemath-dev:8.8
-
-test:8.7:
-  << : *test
-  image: sagemath/sagemath-dev:8.7
-
-test:8.6:
-  << : *test
-  image: sagemath/sagemath-dev:8.6


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000..fcba73a6
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,51 @@
+name: Test
+on:
+  push: { branches: [ "master" ] }
+  pull_request: { branches: [ "master" ] }
+
+jobs:
+  test:
+    runs-on: ubuntu-20.04
+    strategy:
+      matrix:
+        include:
+          - optionals: "sage, pplpy"
+            packages: "sagelib=8.8"
+          - optionals: "sage, pplpy"
+            packages: "sagelib=8.9"
+          - optionals: "sage, pplpy, mzv"
+            packages: "sagelib=9.1"
+          - optionals: "sage, pplpy, mzv, gmpxxyy, pyeantic, pyintervalxt, sage_flatsurf"
+            packages: "sagelib=9.1 sage-flatsurf pyflatsurf>=1.1.0 pyeantic>=1.1.1 pyintervalxt>=3.1.0"
+    steps:
+      - uses: actions/checkout@v2
+        with: { submodules: recursive }
+      - uses: conda-incubator/setup-miniconda@v2
+        with: { mamba-version: "*", channels: "flatsurf,conda-forge", channel-priority: true }
+      - name: Install dependencies
+        shell: bash -l {0}
+        run: |
+          mamba install --yes --quiet pip pytest pytest-xdist ipywidgets scipy matplotlib-base gap-defaults ${{ matrix.packages }}
+          conda activate test
+          conda list
+      - name: Install surface-dynamics
+        shell: bash -l {0}
+        run: |
+          pip install --verbose --no-index .
+          # Show message about cppyy regenerating pre-compiled headers so it does not show during the tests
+          python -c 'import cppyy' || true
+      - name: Run SageMath doctests
+        shell: bash -l {0}
+        run: |
+          export SURFACE_DYNAMICS_INSTALL="$(sage -c 'import surface_dynamics; print(surface_dynamics.__path__[0])')"
+          sage -tp --force-lib --long --optional=${{ matrix.optionals }} ${SURFACE_DYNAMICS_INSTALL} doc
+      - name: Run pytest
+        shell: bash -l {0}
+        run: pytest -n auto
+      - name: Show logs
+        run: grep "" /dev/null `find -name '*.log'` || true
+        if: ${{ always() }}
+
+env:
+  MAKEFLAGS: -j2
+  SAGE_NUM_THREADS: 2