Repository: micropython/micropython-esp32-ulp (language: python)

Issue:
move from travis-ci to github actions
testing on travis-ci is broken - a good opportunity to move it to github actions.

this should be done before merging any other code change.


Discussion / hints:

Fix patch:
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 307e4ff..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-language: c
-dist: trusty
-sudo: false
-addons:
-  apt:
-    packages:
-      - libffi-dev
-      - pkg-config
-
-
-script:
-  - export VER=$(git describe --always --tags)
-  - echo ${VER}
-
-  ###### Install tools ######
-
-  - echo -e "travis_fold:start:build_micropython"
-  - echo "Building micropython"
-  - git clone --recursive https://github.com/micropython/micropython.git
-  - pushd micropython/ports/unix
-  - git describe --always --tags
-  - make axtls
-  - make
-  - export PATH=$PATH:$PWD
-  - test $(micropython -c 'print("test")') = "test"
-  - popd
-  - echo -e "travis_fold:end:build_micropython"
-
-  - echo -e "travis_fold:start:build_binutils"
-  - echo "Building binutils-esp32ulp"
-  - git clone https://github.com/espressif/binutils-esp32ulp.git
-  - pushd binutils-esp32ulp
-  - git describe --always --tags
-  - ./configure --target=esp32ulp-elf --prefix=$PWD/dist --disable-doc --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
-  - echo "MAKEINFO = :" >> Makefile
-  - make
-  - make install-strip
-  - export PATH=$PATH:$PWD/dist/bin
-  - esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null
-  - popd
-  - echo -e "travis_fold:end:build_binutils"
-
-  ###### Run tests ######
-
-  - pushd tests
-  
-  - echo -e "travis_fold:start:unit_tests"
-  - ./00_unit_tests.sh
-  - echo -e "travis_fold:end:unit_tests"
-
-  - echo -e "travis_fold:start:compat_tests"
-  - ./01_compat_tests.sh
-  - echo -e "travis_fold:end:compat_tests"
-


Test patch:
diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml
new file mode 100644
index 0000000..166a2e5
--- /dev/null
+++ b/.github/workflows/run_tests.yaml
@@ -0,0 +1,74 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+  tests:
+    runs-on: ubuntu-18.04
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        fetch-depth: 1
+
+    - name: Install dependencies
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y libffi-dev pkg-config bison flex
+
+    - name: Record version
+      run: |
+        export VER=$(git describe --always --tags)
+        echo ${VER}
+
+    ###### Install tools ######
+
+    - name: Build MicroPython
+      id: build_micropython
+      run: |
+        echo "Building micropython"
+        git clone --depth 1 https://github.com/micropython/micropython.git
+        pushd micropython/mpy-cross
+        make
+        popd
+        pushd micropython/ports/unix
+        git describe --always --tags
+        make submodules
+        make
+        export PATH=$PATH:$PWD
+        echo "::set-output name=bin_dir::$PWD"
+        test $(micropython -c 'print("test")') = "test"
+        popd
+
+    - name: Build binutils-esp32ulp
+      id: build_binutils
+      run: |
+        echo "Building binutils-esp32ulp"
+        git clone --depth 1 https://github.com/espressif/binutils-esp32ulp.git
+        pushd binutils-esp32ulp
+        git describe --always --tags
+        ./configure --target=esp32ulp-elf --prefix=$PWD/dist --disable-doc --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
+        echo "MAKEINFO = :" >> Makefile
+        make
+        make install-strip
+        export PATH=$PATH:$PWD/dist/bin
+        echo "::set-output name=bin_dir::$PWD/dist/bin"
+        esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null
+        popd
+
+    ###### Run tests ######
+
+    - name: Run unit tests
+      id: unit_tests
+      run: |
+        export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
+        cd tests
+        ./00_unit_tests.sh
+
+    - name: Run compat tests
+      id: compat_tests
+      run: |
+        export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
+        export PATH=$PATH:${{ steps.build_binutils.outputs.bin_dir }}
+        cd tests
+        ln -s ../binutils-esp32ulp  # already cloned earlier. reuse.
+        ./01_compat_tests.sh