Repository: larray-project/larray_eurostat (language: python)

Issue:
replace Travis-CI by Github Actions



Discussion / hints:

Fix patch:
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c80d615..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-# References
-# - https://gist.github.com/dan-blanchard/7045057
-# - https://github.com/numba/numba/blob/master/.travis.yml
-dist: xenial         # required for Python >= 3.7
-language: python
-
-python:
-    - "3.7"
-    - "3.8"
-    - "3.9"
-
-branches:
-    only:
-        - master
-
-before_install:
-    # Install Miniconda
-    # We do this conditionally because it saves us some downloading if the
-    # version is the same.
-    - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
-    - bash miniconda.sh -b -p $HOME/miniconda
-    - export PATH="$HOME/miniconda/bin:$PATH"
-    - hash -r
-    - conda config --add channels conda-forge
-    - conda config --set always_yes yes --set changeps1 no
-    - conda update -q conda
-
-    # Useful for debugging any issues with conda
-    - conda info -a
-
-    # clone larray repository
-    - git clone https://github.com/larray-project/larray.git larray
-
-install:
-    # Setup environment
-    - conda create -n travisci --yes python=${TRAVIS_PYTHON_VERSION:0:3}
-            pandas pytest
-    - source activate travisci
-
-    # install larray
-    - cd ./larray
-    - python setup.py install
-    - cd ..
-
-script:
-    - pytest
-
-notifications:
-    on_success: "change"
-    on_failure: "always"
-
-# use container-based infrastructure
-sudo: false
diff --git a/environment.yml b/environment.yml
new file mode 100644
index 0000000..b135b66
--- /dev/null
+++ b/environment.yml
@@ -0,0 +1,11 @@
+name: test
+channels:
+  - defaults
+  - larray-project
+dependencies:
+  - pip
+  - larray
+  - pytest>=3.5
+  - flake8
+  - pip:
+    - pytest-flake8
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/test-larray-eurostat.yml b/.github/workflows/test-larray-eurostat.yml
new file mode 100644
index 0000000..9892787
--- /dev/null
+++ b/.github/workflows/test-larray-eurostat.yml
@@ -0,0 +1,40 @@
+name: Test LArray Eurostat
+
+# Triggers the workflow on push or pull request events
+on: [push, pull_request]
+
+jobs:
+  build-linux:
+    # name: Test (${{ matrix.python-version }}, ${{ matrix.os }})
+    name: Test on ${{ matrix.python-version }}
+    # runs-on: ${{ matrix.os }}
+    runs-on: ubuntu-latest
+    strategy:
+      max-parallel: 5
+      fail-fast: false
+      matrix:
+        # os: ["ubuntu-latest", "macos-latest", "windows-latest"]
+        python-version: [3.7, 3.8, 3.9]
+
+    defaults:
+      run:
+        shell: bash -l {0}
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: conda-incubator/setup-miniconda@v2
+      with:
+        auto-update-conda: true
+        environment-file: environment.yml
+        python-version: ${{ matrix.python-version }}
+    - run: conda info
+    - run: conda list
+    - run: conda config --show
+#    - name: Lint with flake8
+#      run: |
+#        # stop the build if there are Python syntax errors or undefined names
+#        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+#        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+#        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+    - run: pytest