Skip to content

Merge pull request #100 from pidou46/patch-1 #186

Merge pull request #100 from pidou46/patch-1

Merge pull request #100 from pidou46/patch-1 #186

Workflow file for this run

#
# This file is part of the micropython-esp32-ulp project,
# https://github.com/micropython/micropython-esp32-ulp
#
# SPDX-FileCopyrightText: 2018-2023, the micropython-esp32-ulp authors, see AUTHORS file.
# SPDX-License-Identifier: MIT
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git build-essential libffi-dev pkg-config python3 bison flex xxd
- 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 OUTDIR=$PWD/build-standard
export PATH=$PATH:$OUTDIR
echo "bin_dir=$OUTDIR" >> $GITHUB_OUTPUT
test $(micropython -c 'print("test")') = "test"
popd
- name: Fetch binutils-esp32ulp
id: fetch_binutils
run: |
echo "Fetching URL of pre-built esp32ulp-elf binaries"
## URL to pre-built binaries is published in esp-idf
IDFVER=v5.0.1
curl -s \
-o tools.json \
https://raw.githubusercontent.com/espressif/esp-idf/$IDFVER/tools/tools.json
URL=$(<tools.json jq -r '
.tools[]
| select(.name == "esp32ulp-elf").versions[]
| select(.status == "recommended")
| .["linux-amd64"]
| .url
// empty
')
echo "Downloading esp32ulp-elf from $URL"
curl -sL \
-o /tmp/esp32ulp-elf.tar.gz \
$URL
tar xfvz /tmp/esp32ulp-elf.tar.gz esp32ulp-elf/bin
export PATH=$PATH:$PWD/esp32ulp-elf/bin
echo "bin_dir=$PWD/esp32ulp-elf/bin" >> $GITHUB_OUTPUT
esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null
###### 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.fetch_binutils.outputs.bin_dir }}
cd tests
./01_compat_tests.sh
- name: Run compat tests with RTC macros
id: compat_rtc_tests
run: |
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
export PATH=$PATH:${{ steps.fetch_binutils.outputs.bin_dir }}
cd tests
./02_compat_rtc_tests.sh
- name: Run disassembler tests
id: disassembler_tests
run: |
export PATH=$PATH:${{ steps.build_micropython.outputs.bin_dir }}
cd tests
./03_disassembler_tests.sh