Repository: mie-lab/trackintel (language: python)

Issue:
BUG/TST: Github action failed
Our daily GitHub action failed 8 days ago when we had our last pull request. 
I suspect that some changes from #361 is causing the error.



Discussion / hints:
Looks to me like it is only the codecov failing because I did not have a test for the case `if_crs_planar`. See [here](https://codecov.io/gh/mie-lab/trackintel/commit/1ff2323c868cfb82c0d0497cf57281c821e044d1#D4-37)
We can add a test for that and see if the problem is resolved
> 

Ahh okay. I was more thinking of the scheduled tests - if you click on Actions you can see an array of failed scheduled tests since 7 days ago. The error message reads: `The job running on runner Hosted Agent has exceeded the maximum execution time of 360 minutes.` while our tests last usually ~15min

I don't know where the error comes from but suspect that we might have changed something in the last commit. But it also could be an error from the Github Action itself.
> > 
> 
> Ahh okay. I was more thinking of the scheduled tests - if you click on Actions you can see an array of failed scheduled tests since 7 days ago. The error message reads: `The job running on runner Hosted Agent has exceeded the maximum execution time of 360 minutes.` while our tests last usually ~15min
> 
> I don't know where the error comes from but suspect that we might have changed something in the last commit. But it also could be an error from the Github Action itself.

I think the error comes from somewhere else than our PR. My fork has not yet integrated the last PR but still have these failed test since 7 days ago

Fix patch:
diff --git a/ci/envs/37-latest-conda-forge.yaml b/.github/envs/conda-forge-env.yaml
similarity index 95%
rename from ci/envs/37-latest-conda-forge.yaml
rename to .github/envs/conda-forge-env.yaml
index 5a64500a..6de281d8 100644
--- a/ci/envs/37-latest-conda-forge.yaml
+++ b/.github/envs/conda-forge-env.yaml
@@ -3,7 +3,6 @@ channels:
   - conda-forge
   - defaults
 dependencies:
-- python=3.7
 - matplotlib
 - numpy
 - pandas<=1.2.5
diff --git a/ci/envs/setup_postgres.sh b/.github/envs/setup_postgres.sh
similarity index 100%
rename from ci/envs/setup_postgres.sh
rename to .github/envs/setup_postgres.sh


Test patch:
diff --git a/.github/workflows/CI-tests.yml b/.github/workflows/CI-tests.yml
index 3c267ac2..8fd76392 100644
--- a/.github/workflows/CI-tests.yml
+++ b/.github/workflows/CI-tests.yml
@@ -10,55 +10,43 @@ on:
     - cron: "0 0 * * *" # repeat every day
 
 jobs:
-  Test:
-    name: ${{ matrix.os }}, ${{ matrix.env }}
+  ubuntu-latest:
+    name: ${{ matrix.os }}, ${{ matrix.python-version }}
     runs-on: ${{ matrix.os }}   
     strategy:
       matrix:
-        os: [ubuntu-latest]
-        postgis: [false]
-        dev: [false]
-        env:
-          - ci/envs/37-latest-conda-forge.yaml
-          - ci/envs/38-latest-conda-forge.yaml
-          - ci/envs/39-latest-conda-forge.yaml
-        include:
-          - env: ci/envs/38-latest-conda-forge.yaml
-            os: macos-latest
-            postgis: false
-            dev: false
-          - env: ci/envs/38-latest-conda-forge.yaml
-            os: windows-latest
-            postgis: false
-            dev: false
+        os: [ubuntu-latest, macos-latest, windows-latest]
+        python-version: ["3.8", "3.9"]
       
     steps:
     - uses: actions/checkout@v2
-    - name: Setup Conda
-      uses: s-weigand/setup-conda@v1
-      with:
-        activate-conda: false
 
-    - name: Install Env
-      shell: bash
-      run: conda env create -f ${{ matrix.env }}
+    - name: Set up Python environment
+      uses: conda-incubator/setup-miniconda@v2
+      with:
+          activate-environment: test
+          environment-file: .github/envs/conda-forge-env.yaml
+          python-version: ${{ matrix.python-version }}
+          auto-activate-base: false
 
     - name: Test with pytest
-      shell: bash
+      shell: bash -l {0}
       run: |
-        source activate test
         pytest -v -r s -n auto --color=yes --cov=trackintel --cov-append --cov-report term-missing --cov-report xml tests/
 
+  
     - name: Test with PostGIS
-      shell: bash
-      if: contains(matrix.env, '38-latest-conda-forge.yaml') && contains(matrix.os, 'ubuntu')
+      shell: bash -l {0}
+      if: contains(matrix.python-version, '3.8') && contains(matrix.os, 'ubuntu')
       env:
         PGUSER: postgres
         PGPASSWORD: postgres
         PGHOST: "127.0.0.1"
       run: |
-        source activate test
         conda install postgis -c conda-forge
-        source ci/envs/setup_postgres.sh
+        source .github/envs/setup_postgres.sh
         pytest -v -r s --color=yes --cov=trackintel --cov-append --cov-report term-missing --cov-report xml tests/io/test_postgis.py | tee /dev/stderr | if grep SKIPPED >/dev/null;then echo "TESTS SKIPPED, FAILING" && exit 1;fi
-    - uses: codecov/codecov-action@v1
\ No newline at end of file
+
+    - name: Codecov report
+      if: contains(matrix.python-version, '3.8') && contains(matrix.os, 'ubuntu')
+      uses: codecov/codecov-action@v1
\ No newline at end of file
diff --git a/ci/envs/38-latest-conda-forge.yaml b/ci/envs/38-latest-conda-forge.yaml
deleted file mode 100644
index e3896e52..00000000
--- a/ci/envs/38-latest-conda-forge.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: test
-channels:
-  - conda-forge
-  - defaults
-dependencies:
-- python=3.8
-- matplotlib
-- numpy
-- pandas<=1.2.5
-- geopandas
-- scikit-learn
-- networkx 
-- pint
-- pip 
-- geoalchemy2 
-- osmnx 
-- psycopg2
-- pytest
-- pytest-cov
-- pytest-xdist
-- tqdm
-- similaritymeasures
-- pygeos
-- jupyter
diff --git a/ci/envs/39-latest-conda-forge.yaml b/ci/envs/39-latest-conda-forge.yaml
deleted file mode 100644
index 488da4e8..00000000
--- a/ci/envs/39-latest-conda-forge.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: test
-channels:
-  - conda-forge
-  - defaults
-dependencies:
-- python=3.9
-- matplotlib
-- numpy
-- pandas<=1.2.5
-- geopandas
-- scikit-learn
-- networkx 
-- pint
-- pip 
-- geoalchemy2 
-- osmnx 
-- psycopg2
-- pytest
-- pytest-cov
-- pytest-xdist
-- tqdm
-- similaritymeasures
-- pygeos
-- jupyter