|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + tests: |
| 7 | + runs-on: ubuntu-18.04 |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v2 |
| 10 | + with: |
| 11 | + fetch-depth: 1 |
| 12 | + |
| 13 | + - name: Install dependencies |
| 14 | + run: | |
| 15 | + sudo apt-get update |
| 16 | + sudo apt-get install -y libffi-dev pkg-config bison flex |
| 17 | +
|
| 18 | + - name: Record version |
| 19 | + run: | |
| 20 | + export VER=$(git describe --always --tags) |
| 21 | + echo ${VER} |
| 22 | +
|
| 23 | + ###### Install tools ###### |
| 24 | + |
| 25 | + - name: Build MicroPython |
| 26 | + id: build_micropython |
| 27 | + run: | |
| 28 | + echo "Building micropython" |
| 29 | + git clone --depth 1 https://github.com/micropython/micropython.git |
| 30 | + pushd micropython/mpy-cross |
| 31 | + make |
| 32 | + popd |
| 33 | + pushd micropython/ports/unix |
| 34 | + git describe --always --tags |
| 35 | + make submodules |
| 36 | + make |
| 37 | + export PATH=$PATH:$PWD |
| 38 | + echo "::set-output name=bin_dir::$PWD" |
| 39 | + test $(micropython -c 'print("test")') = "test" |
| 40 | + popd |
| 41 | +
|
| 42 | + - name: Build binutils-esp32ulp |
| 43 | + id: build_binutils |
| 44 | + run: | |
| 45 | + echo "Building binutils-esp32ulp" |
| 46 | + git clone --depth 1 https://github.com/espressif/binutils-esp32ulp.git |
| 47 | + pushd binutils-esp32ulp |
| 48 | + git describe --always --tags |
| 49 | + ./configure --target=esp32ulp-elf --prefix=$PWD/dist --disable-doc --disable-gdb --disable-libdecnumber --disable-readline --disable-sim |
| 50 | + echo "MAKEINFO = :" >> Makefile |
| 51 | + make |
| 52 | + make install-strip |
| 53 | + export PATH=$PATH:$PWD/dist/bin |
| 54 | + echo "::set-output name=bin_dir::$PWD/dist/bin" |
| 55 | + esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null |
| 56 | + popd |
| 57 | +
|
| 58 | + ###### Run tests ###### |
| 59 | + |
| 60 | + - name: Run unit tests |
| 61 | + id: unit_tests |
| 62 | + run: | |
| 63 | + export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }} |
| 64 | + cd tests |
| 65 | + ./00_unit_tests.sh |
| 66 | +
|
| 67 | + - name: Run compat tests |
| 68 | + id: compat_tests |
| 69 | + run: | |
| 70 | + export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }} |
| 71 | + export PATH=$PATH:${{ steps.build_binutils.outputs.bin_dir }} |
| 72 | + cd tests |
| 73 | + ln -s ../binutils-esp32ulp # already cloned earlier. reuse. |
| 74 | + ./01_compat_tests.sh |
0 commit comments